10.02.2014, 19:16
Hey, i made my give money command and it gives no errors but when i type '/givemoney 1(playerid) 1(Ammount)' it gives him 49$ and when i type 2 it gives him 50$.
My code:
My code:
pawn Код:
CMD:givemoney(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] == 1 || IsPlayerAdmin(playerid))
{
new pID, kolicina;
if(sscanf(params, "us", pID, kolicina))return SendClientMessage(playerid, -1, ""BOJA_PLAVA"[Info]"BOJA_BELA" Pravilan Sintaks: /givemoney [DeoImena/ID] [Kolicina].");
if(pID == INVALID_PLAYER_ID)return SendClientMessage(playerid, -1, ""BOJA_PLAVA"[Info]"BOJA_BELA" Igrac nije pronadjen ili nije konektovan.");
new string[128], string2[128];
new ime_igraca[MAX_PLAYER_NAME];
GetPlayerName(playerid, ime_igraca, sizeof(ime_igraca));
format(string, sizeof (string), ""BOJA_CRVENA"[Novac]"BOJA_BELA" Admin %s vam je dao %d$.", ime_prezime(playerid), kolicina);
format(string2, sizeof (string2), ""BOJA_CRVENA"[Novac]"BOJA_BELA" Dali ste igracu %s %d$.", ime_igraca, kolicina);
SendClientMessage(pID, -1, string);
SendClientMessage(playerid, -1, string2);
GivePlayerMoney(pID, kolicina);
}
else
{
SendClientMessage(playerid, -1, ""BOJA_PLAVA"[Info]"BOJA_BELA" Niste ovlasceni da koristite ovu komandu.");
}
return 1;
}