Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: ‹Fox› poslato Oktobar 10, 2010, 08:33:54 PRE PODNE

Naslov: [pomoc]Givedrug
Poruka od: ‹Fox› poslato Oktobar 10, 2010, 08:33:54 PRE PODNE
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;
}
Naslov: Odg: [pomoc]Givedrug
Poruka od: BOSNIACUS poslato Oktobar 10, 2010, 08:35:59 PRE PODNE
mozda nemozes sam sebi dati drogu  ???
Naslov: Odg: [pomoc]Givedrug
Poruka od: ‹Fox› poslato Oktobar 10, 2010, 08:50:19 PRE PODNE
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
Naslov: Odg: [pomoc]Givedrug
Poruka od: Joey_ poslato Oktobar 10, 2010, 11:14:26 PRE PODNE
Nedostaje ti jedan = kod:


if(dID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAD1, "Taj igrac je offline"); 
Naslov: Odg: [pomoc]Givedrug
Poruka od: ‹Fox› poslato Oktobar 10, 2010, 13:30:30 POSLE PODNE
rijeseno, lock