/jail command [target] -
florent6001 - 06.02.2014
Hi all !
I need your help : I'm beginner and i want script /jail command.
Please help me for scripting this command?
Please help me for command with target..
I can't do command with target... Please helpe me.
I not understand this system with target..
Help me, i can learn sscanf, ...
Thank's for your help, sorry for my very good english ^^
Re: /jail command [target] -
MrTinder - 06.02.2014
pawn Code:
CMD:jail(playerid, params[])
{
new target, string[256], name[24], targetname[24];
if(sscanf(params, "r", target)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /jail {target}");
SetPlayerInterior(playerid, interiorID);
SetPlayerPos(playerid, X, Y, Z);
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(target, targetname, sizeof(targetname));
format(string, sizeof(string), "%s put %s in jail.", name, targetname);
return 1;
}
btw... change SetPlayerInterior(playerid, interiorID); and SetPlayerPos(playerid, X, Y, Z); to what u wanna =]
Re : /jail command [target] -
florent6001 - 06.02.2014
Thank's for the script, but i not want you send script to me,
I want learn target system, you know?
Re: Re : /jail command [target] -
Don_Cage - 06.02.2014
Quote:
Originally Posted by florent6001
Thank's for the script, but i not want you send script to me,
I want learn target system, you know?
|
This man deservs a reward for those words!
zcmd and sscanf is easiest
Read how to use sscanf here
http://forum.sa-mp.com/showthread.ph...ghlight=sscanf
Re : /jail command [target] -
florent6001 - 06.02.2014
Thank's for the link man

I go look that's, but help my for my second problem please
Quote:
if(sscanf(params, "r", target)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /jail {target}");
|
And look that's :
error 017: undefined symbol "params"
Re: /jail command [target] -
Don_Cage - 06.02.2014
What command processor are you using?
Re : /jail command [target] -
florent6001 - 06.02.2014
Quote:
if (strcmp("/jail", cmdtext, true, 10) == 0)
{
new target, string[256], name[24], targetname[24];
if(sscanf(params, "r", target)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /jail {target}");
SetPlayerInterior(playerid, interiorID);
SetPlayerPos(playerid, X, Y, Z);
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(target, targetname, sizeof(targetname));
format(string, sizeof(string), "%s put %s in jail.", name, targetname);
return 1;
}
|
My command,
but error : error 017: undefined symbol "params"
In line 219
Quote:
if(sscanf(params, "r", target)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /jail {target}");
|
Re: /jail command [target] -
MrTinder - 06.02.2014
Well..u are using strcmp i give you the command for zcmd.That's why you got this error.Just change params to cmdtext[11] and all will be fine
Re : /jail command [target] -
florent6001 - 06.02.2014
My include :
Quote:
#include <a_samp>
#include <YSI\y_ini>
#include <sscanf2>
#include <zcmd>
|
Re : /jail command [target] -
florent6001 - 06.02.2014
Help please ..