Roleplay Cuff Problem
#1

pawn Код:
new index;
new cmd[20];
cmd = strtok(cmdtext, index);
if (strcmp(cmd, "/cuff", true) == 0)
{
new tmp[20],
new id;
tmp = strtok(cmdtext, index);
if (strlen(tmp))
{
id = strval(tmp);
if (IsPlayerConnected(id))
{
SendClientMessage(id, 0xFFFFFFFFF, "You have been cuffed and cannot move");
TogglePlayerControllable(id,0);
return 1;
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Player not found");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "[Usage]: /cuff [playerid/name]");
}
return 1;
}
if (strcmp(cmd, "/uncuff", true) == 0)
{
new tmp[20],
new id;
tmp = strtok(cmdtext, index);
if (strlen(tmp))
{
id = strval(tmp);
if (IsPlayerConnected(id))
{
SendClientMessage(id, 0xFFFFFFFFF, "You have been uncuffed");
TogglePlayerControllable(id,1);
return 1;
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Player not found");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "[Usage]: /uncuff [playerid/name]");
}
return 1;
}
Код:
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\cuff.pwn(23) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\cuff.pwn(23) : error 033: array must be indexed (variable "cmd")
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\cuff.pwn(27) : error 001: expected token: "-identifier-", but found "new"
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\cuff.pwn(28) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\cuff.pwn(28) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\cuff.pwn(31) : error 017: undefined symbol "id"
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\cuff.pwn(32) : error 017: undefined symbol "id"
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\cuff.pwn(34) : error 017: undefined symbol "id"
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\cuff.pwn(35) : error 017: undefined symbol "id"
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\cuff.pwn(52) : error 001: expected token: "-identifier-", but found "new"
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\cuff.pwn(53) : error 017: undefined symbol "strtok"
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\cuff.pwn(53) : error 033: array must be indexed (variable "tmp")
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\cuff.pwn(56) : error 017: undefined symbol "id"
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\cuff.pwn(57) : error 017: undefined symbol "id"
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\cuff.pwn(59) : error 017: undefined symbol "id"
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\cuff.pwn(60) : error 017: undefined symbol "id"
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\cuff.pwn(74) : warning 217: loose indentation
C:\Documents and Settings\Joe\My Documents\Tools\SA-MP\filterscripts\cuff.pwn(21) : warning 203: symbol is never used: "index"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


16 Errors.
Whats wrong? Im creating a new rp from scratch and getting these errors
Reply
#2

Is your commands in the correct place?
Reply
#3

Its under OnPlayerCommandText
Reply
#4

Change id to playerid
Reply
#5

Quote:
Originally Posted by Joeri
Change id to playerid
No, No and no!
:P if i changed id to playerid it wud cuff and uncuff the player who said the command,
Not the id of the person indicated eg: /cuff 3
Reply
#6

I ment giveplayerid my bad
Reply
#7

That'll do nothing, id is just the same as giveplayerid, There is no difference, it is just a name given to something.
Reply
#8

Anyone know a solution?
Reply
#9

Any help will be much appreciated,

EDIT: Sorry 4 Double Post
Reply
#10

Someone help please lol i cant do anything this is doing what its doing,

EDIT: Sorry i clicked post by accident when i went to take it off
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)