Hopeless I need an uregent help please. - 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: Hopeless I need an uregent help please. (
/showthread.php?tid=183284)
Hopeless I need an uregent help please. -
Scriptissue - 14.10.2010
I made that script, again trying to make it work but IT DOESN'T .
I made a /frisk command but It doesn't work well, It shows the result like this it writes Empty more then 5 times, even though I wrote only once.
Can any one help me fixing the code, so that it won't show 8 messages of "1. Empty" and then 8 messages of "1.Empty" and one with the gun.
pawn Код:
if(strcmp(cmd, "/checkweapon", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GREY, "You are not authorized");
return 1;
}
tmp = strtok(cmdtext,idx);
if (!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /checkweapon [playerid/partOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (giveplayerid == INVALID_PLAYER_ID)
{
SendClientMessage(playerid, COLOR_GREY, "That player is offline");
return 1;
}
new sweapon, sammo;
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "%s has the following weapons:", giveplayer);
SendClientMessage(playerid, COLOR_GRAD1, string);
for (new i=0; i<9; i++)
{
GetPlayerWeaponData(giveplayerid, i, sweapon, sammo);
if(sweapon != 0)
{
format(string, sizeof(string), "%d: %d (%d)", i, sweapon, sammo);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "1. Empty");
}
}
return 1;
}
Re: Hopeless I need an uregent help please. -
Scriptissue - 14.10.2010
Anyone please I have been trying since yesterday I can't make it work,.
Re: Hopeless I need an uregent help please. -
LarzI - 14.10.2010
You are sending the message within the loop, which repeats till i = 9 (9 - 0 = 9, aka 9 times)
Re: Hopeless I need an uregent help please. -
Scriptissue - 15.10.2010
It changed it, but now when I try to frisk it just says : 1.Empty, even If I have a weapon.
Re: Hopeless I need an uregent help please. -
Scriptissue - 15.10.2010
Anyone please I can't make it work, It has been like that since Wednesday.