/jail command [target]
#1

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 ^^
Reply
#2

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 =]
Reply
#3

Thank's for the script, but i not want you send script to me,
I want learn target system, you know?
Reply
#4

Quote:
Originally Posted by florent6001
View Post
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
Reply
#5

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"
Reply
#6

What command processor are you using?
Reply
#7

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}");

Reply
#8

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
Reply
#9

My include :
Quote:

#include <a_samp>
#include <YSI\y_ini>
#include <sscanf2>
#include <zcmd>

Reply
#10

Help please ..
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)