SA-MP Forums Archive
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: help please (/showthread.php?tid=171752)



help please - bartje01 - 27.08.2010

Hey guys. I want to make a /setstat playerid statname ammount command.
It doesn't work.

I have this:
pawn Код:
dcmd_setstat(playerid,params[])
{
new ammount,statname,ID;
if(adminlevel[playerid]<=2)

{
SendClientMessage(playerid,COLOR_RED,"Je mag dit niet doen");
return 1;
}

if(sscanf(params,"usd",ID,statname,ammount))
{
SendClientMessage(playerid,COLOR_GREY,"Gebruik /setstat [playerid] [stat] [ammount]");
return 1;
}

if(statname == "money")
{

}

return 1;
}
This:
pawn Код:
if(statname == "money")
{

}
Doesn't work. It says:
Код:
C:\Users\Bart\Desktop\Rubenbart server\gamemodes\SunlightRPG.pwn(559) : error 033: array must be indexed (variable "-unknown-")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: help please - Dolph - 27.08.2010

maybe return 1; in the statname?


Re: help please - bartje01 - 27.08.2010

Nope. That's not it


Re: help please - Vince - 27.08.2010

Please, only reply when you actually know what you're doing.
pawn Код:
if(!strcmp(statname, "money", true))
Dit forum vereist dat je 120 seconden wacht tussen het verzenden van berichten. Probeer het nogmaals over 5 seconden. <= Argh


Re: help please - bartje01 - 27.08.2010

if(!strcmp(statname, "money", true))
{

}


Код:
C:\Users\Bart\Desktop\Rubenbart server\gamemodes\SunlightRPG.pwn(559) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
ty for helping btw


Re: help please - Adil - 27.08.2010

All you have to do is give the variable statname an array value. This can be done by changing new statname; to new statname[20];.


Re: help please - bartje01 - 27.08.2010

lol works. Thanks


Re: help please - bartje01 - 28.08.2010

Quote:
Originally Posted by Micheliano
Посмотреть сообщение
i told u -.-
NOpe. I had it with:
pawn Код:
if(statname == "money")
{

}
That is why it didn't worked