SA-MP Forums Archive
Roleplay Cuff Problem - 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: Roleplay Cuff Problem (/showthread.php?tid=81548)



Roleplay Cuff Problem - JoeDaDude - 11.06.2009

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


Re: Roleplay Cuff Problem - miokie - 11.06.2009

Is your commands in the correct place?


Re: Roleplay Cuff Problem - JoeDaDude - 11.06.2009

Its under OnPlayerCommandText


Re: Roleplay Cuff Problem - joeri55 - 11.06.2009

Change id to playerid


Re: Roleplay Cuff Problem - JoeDaDude - 11.06.2009

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


Re: Roleplay Cuff Problem - joeri55 - 11.06.2009

I ment giveplayerid my bad


Re: Roleplay Cuff Problem - miokie - 11.06.2009

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


Re: Roleplay Cuff Problem - JoeDaDude - 11.06.2009

Anyone know a solution?


Re: Roleplay Cuff Problem - JoeDaDude - 11.06.2009

Any help will be much appreciated,

EDIT: Sorry 4 Double Post


Re: Roleplay Cuff Problem - JoeDaDude - 11.06.2009

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