ID - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: ID (
/showthread.php?tid=120016)
ID -
armyoftwo - 10.01.2010
http://platzii.com/pastebin/110
I can sell to invalid id's
like
/sellgun 3153 mp5
it gives me mp5
Re: ID -
BMUK - 10.01.2010
You need to have this
Код:
tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp);
before you use "giveplayerid"
So put that at thetop ofyour command and you should be ok
Re: ID -
ғαιιοцт - 10.01.2010
you need to add if(IsPlayerConnected(giveplayerid)) too
Re: ID -
armyoftwo - 11.01.2010
http://platzii.com/pastebin/111
it sends me those lines in chat:
Код:
SendClientMessage(playerid, COLOR_WHITE, "*** Sell Guns ***");
SendClientMessage(playerid, COLOR_GREY, "USAGE: /sellgun [id] [gun]");
SendClientMessage(playerid, COLOR_GREY, "AVAILABLE GUNS**:mp5, m4, deagle, shotgun, ak47, 9mm");
SendClientMessage(playerid, COLOR_GREY, "ERROR: Wrong ID OR WRONG WEAPON NAME");
when i type /sellgun 0 mp5
Re: ID -
armyoftwo - 12.01.2010
bump
Re: ID -
ғαιιοцт - 12.01.2010
Код:
if(strcmp(cmd, "/sellgun", true) == 0) {
GetPlayerPos(giveplayerid,px,py,pz);
tmp = strtok(cmd, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_GREEN, "________________________________________________");
SendClientMessage(playerid, COLOR_WHITE, "*** Sell Guns ***");
SendClientMessage(playerid, COLOR_GREY, "USAGE: /sellgun [id] [gun]");
SendClientMessage(playerid, COLOR_GREY, "AVAILABLE GUNS**:mp5, m4, deagle, shotgun, ak47, 9mm");
SendClientMessage(playerid, COLOR_GREEN, "________________________________________________");
return 1;
}
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID) {
x_info = strtok(cmd, idx);
if(!strlen(x_info)) {
SendClientMessage(playerid, COLOR_GREEN, "________________________________________________");
SendClientMessage(playerid, COLOR_WHITE, "*** Sell Guns ***");
SendClientMessage(playerid, COLOR_GREY, "USAGE: /sellgun [id] [gun]");
SendClientMessage(playerid, COLOR_GREY, "AVAILABLE GUNS**:mp5, m4, deagle, shotgun, ak47, 9mm");
SendClientMessage(playerid, COLOR_GREY, "ERROR: Wrong ID OR WRONG WEAPON NAME");
SendClientMessage(playerid, COLOR_GREEN, "________________________________________________");
return 1;
}
}
does this work?