Need some help. - 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)
+--- Thread: Need some help. (
/showthread.php?tid=310872)
Need some help. -
nogh445 - 14.01.2012
I'm a bit confused here.
I'm making it so when you type /ak it will say "this will cost $400, if you're sure type /ak yes" (thats where the "yes" comes from) I have this done but the /ak yes code is acting up now.
Pawn code:
pawn Код:
CMD:ak yes(playerid, params[])
{
GivePlayerWeapon(playerid, 30, 10000 );
GivePlayerMoney(playerid, -400);
return 1;
}
Errors:
Код:
C:\Users\user\Desktop\SAMP SERVER STUFF\A. My servers\Kush Mania\pawno\KM.pwn(954) : error 001: expected token: "(", but found "-identifier-"
C:\Users\user\Desktop\SAMP SERVER STUFF\A. My servers\Kush Mania\pawno\KM.pwn(954) : error 001: expected token: ";", but found "("
Line 954 is this one "CMD:ak yes(playerid, params[])"
Re: Need some help. -
ScriptJorkis - 14.01.2012
i saw the problem
pawn Код:
CMD:akyes(playerid, params[])
delete your old CMD:ak yes it gives you a trouble
Re: Need some help. -
nogh445 - 14.01.2012
^ worked ^
Thanks
Re: Need some help. -
Steven82 - 14.01.2012
If you want to do "/ak [yes/no]", your going to need to use the sscanf plugin.
Re: Need some help. -
Spooky - 14.01.2012
pawn Код:
CMD:ak(playerid, params[])
{
new ??[128];
if(!sscanf(params,"s[128]", ??))
{
if(strcmp(??,"yes", true) == 0)
{
//do code for yes
}
else if(strcmp(??,"No", true) == 0)
{
//do code here for no
}
}
else SendClientMessage(playerid, -1,"USAGE: /ak [yes/no]");
return 1;
}
I Think This Helped right?
Re: Need some help. -
ScriptJorkis - 14.01.2012
You do not even know what your doing. better stop replying if you don't know about your doing you copy it from strcmp