GTAOnline.net
San Andreas Multiplayer (sa:mp) => Scripting SA-MP [Pawn center] => Discussion démarrée par: ApocKalipsS le 02 Février 2008, 18:50:10
-
Bonjour,
Je cherche comment avoir une monnaie virtuel, un GiveCash qui nous donne par exemple 500$ et quand on tape /argent on a le nombre d'argent...
J'épere que vous avez compris... Merci !
-
je ne comprend pas trop ?
Une monai non hackable ?
Plus le dollar mais un autre truk ?
-
Oui si tu veux...
-
je cherche aussi car les hackers yen a trop !!
-
Faut créer une variable ;)
-
Ah voila je pense avoir trouver :
En haut :
new Argent[MAX_PLAYERS] = 0;
Pour retirer ou avoir de l'argent :
Argent[playerid] += 500;
C'est ça ? Je ne suis pas sûr mon PC donc j'ai pas plus tester...
-
Sa ressemble a sa
tien essai sa quand tu peux
Suprimé a la demander du Proprietaire
-
Bon, je vais essayer de t'aider...
Au dessus de ton GM, prés des includes :
new argent[MAX_PLAYERS] = 0;
Ensuite, pour faire un /givecash :
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new name[MAX_PLAYER_NAME];
new message[256];
new argent2;
if (strcmp(cmd, "/givecash playerid2 argent2", true) == 0)
{
if (argent[playerid] >= argent2)
{
argent[playerid] -= %d", argent2;
argent[playerid2] += %d", argent2;
PlayerPlaySound (playerid, 1053, 0.0, 0.0, 0.0);
format(message, sizeof(message),"Cash points : - %d", argent2);
SendClientMessage(playerid,COLOR_YELLOW,message);
format(message, sizeof(message),"Cash points : + %d", argent2);
SendClientMessage(playerid2,COLOR_YELLOW,message);
}
else (argent[playerid] -= 0);
SendClientMessage(playerid,COLOR_DARKRED,"Tu n'as pas assez de cash pour ça !");
}
}
Je ne pense pas que cette commande marchera, les spécialistes corrigeront cela mais je pense que ca doit se rapprocher de ça...
-
Plein d'error mais oui sa doit y ressembler
-
J'en étais sur.
:boulz
EDIT : merci Marsu.
-
Malppower ==> Je vois pas pourquoi tu veux le supprimer... ?
-
Supprimé pour la protection des droits d'auteurs...
Je veux pas qu'ils y en aient qui prennent mon GM, et puis qu'ils piquent tous les morceaux pour les poster.
-
Désoler
-
Toi tu es pardonné...
-
:)
:cheers
-
:)
:cheers
L'utitliter du message ? ???
-
Façon de s'exprimer comme quoi il est content d'être pardonné ... :/
-
pff .. allez laissez tomber et reprenon le sujet du depars
-
Nouveau :
Je crois que tu vas avoir besoin de l'include Dini pour faire ces commandes...
-
Faut enregistré l'argent dans un bloc note .
-
Qui pourrais m'aider pour l'argent c'est vraiment utile il y a des hacker mercii :king
-
Qui pourrais m'aider pour l'argent c'est vraiment utile il y a des hacker cheater mercii :king
Hacker sur GTA sa existe pas :ninja
NV.
-
Désoler j'ai peux etre male exprimé mais j'aurai besoins de cette monnaie
-
C'est simple tu fait une variable (pour tout les joueur) et si il achete un truc tu fait -12 dans la variable pour qu'il perd de la monaie et blocker quand s'est a 0.
Cherche et tu aprendra beaucoup plus vite... :)
A +
-
Hacker sur GTA sa existe pas :ninja
NV.
On dirais que mes cours t'on été utiles lol
Pour ton problème ASK je crois que le sujet a déjà été abordé...
http://www.gtaonline.fr/forums/index.php/topic,2108.0.html (http://www.gtaonline.fr/forums/index.php/topic,2108.0.html)
-
C'est simple tu fait une variable (pour tout les joueur) et si il achete un truc tu fait -12 dans la variable pour qu'il perd de la monaie et blocker quand s'est a 0.
Cherche et tu aprendra beaucoup plus vite... :)
A +
Je n'ais jamais utiliser quelque chose de variable ou du genre quelqun pourrais maider merci
-
Bon...
J'ai un truc qui devrait déja t'avancer plus...
//au dessus du GM
#include <a_samp>
#include <core>
#include <float>
#include <Dini>
#include <dudb>
#include <dutils>
new argent [MAX_PLAYERS] = 0;
//dans public OnPlayerCommandText
if(strcmp(cmd, "/givecash", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "[!] USAGE: /givecash [idjoueur] [montant]");
return 1;
}
new money;
if(IsStringAName(tmp))
{
giveplayerid = GetPlayerID(tmp);
}
else
{
giveplayerid = strval(tmp);
}
tmp = strtok(cmdtext, idx);
money = strval(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(argent[playerid] <= money);
{
argent[giveplayerid] += money;
format(string, sizeof(string), "*** Vous avez donné a %s %d Cash", giveplayer, money);
SendClientMessage(playerid,COLOR_RED, string);
format(string, sizeof(string), "*** Vous avez recu %d Cash venant de %s", money,sendername);
SendClientMessage(giveplayerid,COLOR_RED, string);
new PlayerName[30];
GetPlayerName(playerid, PlayerName, 30);
printf("[Command] %s a utilise /givecash pour donner a %s le montant de %s Cash", PlayerName, giveplayer, money);
}
else
{
if(argent[playerid] >= money);
{
SendClientMessage(playerid, COLOR_RED, "*** Vous n'avez pas assez de cash.");
return 1;
}
return 1;
}
Non testé, mais il me semble déja beaucoup mieux valable qu'avant :)
-
Merci sa dois y ressembler meme si je mis connais presque pas il y a 24 Erreur :S
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(840) : error 017: undefined symbol "clock"
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(862) : error 004: function "SystemMsg" is not implemented
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(866) : error 004: function "SystemMsg" is not implemented
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(869) : error 004: function "SystemMsg" is not implemented
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(891) : error 004: function "SystemMsg" is not implemented
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(894) : error 004: function "SystemMsg" is not implemented
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(896) : error 004: function "SystemMsg" is not implemented
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(905) : error 004: function "SystemMsg" is not implemented
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(909) : error 004: function "SystemMsg" is not implemented
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(912) : error 004: function "SystemMsg" is not implemented
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(915) : error 004: function "SystemMsg" is not implemented
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(923) : error 017: undefined symbol "tmp"
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(924) : error 017: undefined symbol "tmp"
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(930) : error 017: undefined symbol "IsStringAName"
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(932) : error 017: undefined symbol "giveplayerid"
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(932) : error 017: undefined symbol "GetPlayerID"
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(936) : error 017: undefined symbol "giveplayerid"
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(936) : error 017: undefined symbol "tmp"
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(938) : error 017: undefined symbol "tmp"
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(939) : error 017: undefined symbol "tmp"
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(940) : error 017: undefined symbol "giveplayerid"
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(940) : error 017: undefined symbol "giveplayer"
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(940) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Yo\Bureau\rpgmode.pwn(940) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
24 Errors.
-
moi je remplacerai toute la monaie tu le met dans le scrore .
-
T'as pas oublié les includes ?
-
La plus par ne vienne pas des includes .