[pomoc]Givedrug

Započeo ‹Fox›, Oktobar 10, 2010, 08:33:54 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

ja kad ukucam /givedrug 0 1 kaze mi da je taj igrac offline a ja sam ID 0
evo komande:
dcmd_givedrug(playerid, params[])
{
new dID,
playername[24],
dName[24],
string[128];
new ammount;
if(sscanf(params, "ud", dID, ammount)) return SendClientMessage(playerid, COLOR_GRAD1, "Koristiti: /givedrug [ID][kolicin]");
if(dID = INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAD1, "Taj igrac je offline");
if(dID == playerid) return SendClientMessage(playerid, COLOR_GRAD1, "Nemozete dati drogu samom sebi");
if(PlayerInfo[playerid][pDrugs] >= ammount)
{
new drug = PlayerInfo[dID][pDrugs];
PlayerInfo[dID][pDrugs] = drug+ammount;
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "%s vam je dao %d grama droge", playername, ammount);
SendClientMessage(dID, COLOR_LIGHBLUE, string);
GetPlayerName(dID, dName, sizeof(dName));
format(string2, sizeof(string2), "%s vam je dao %d grama droge", dName, ammount);
SendClientMessage(dID, COLOR_LIGHBLUE, string2);
new drug2 = PlayerInfo[playerid][pDrugs];
PlayerInfo[playerid][pDrugs] = drug2-ammount;
}
if(PlayerInfo[playerid][pDrugs] < ammount)
{
SendClientMessage(playerid, COLOR_GRAD1, "Nemate toliko droge kod sebe");
}
return 1;
}

mozda nemozes sam sebi dati drogu  ???

ali nekaze mi to sta sam napisao da nemoug dati drogu sam sebi nego mi kaze da je taj igrac offline a taj igrac nije offline samo sam to iso testat i nece

Nedostaje ti jedan = kod:


if(dID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAD1, "Taj igrac je offline"); 

Last nick: Paradox

rijeseno, lock
Poslednja Izmena: Oktobar 10, 2010, 15:45:40 POSLE PODNE od \\!~!//DeFox\\!~!//