if(!strcmp(cmd,"/cuff",true))
{
cmd=strtok(cmdtext,idx);
if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /cuff playerid");
id=ReturnUser(cmd);
if(!IsPlayerConnected(layerid)) return SendClientMessage(playerid,COLOR_GREY,"Invalid player id.");
TogglePlayerControllable(layerid,0);
GameTextForPlayer(playerid, "~y~ hand cuffs!",2500,3);
return true;
}
C:\Documents and Settings\Joeri\Bureaublad\samp server\gamemodes\penls.pwn(9256) : error 017: undefined symbol "id" C:\Documents and Settings\Joeri\Bureaublad\samp server\gamemodes\penls.pwn(9256) : error 017: undefined symbol "ReturnUser" C:\Documents and Settings\Joeri\Bureaublad\samp server\gamemodes\penls.pwn(9257) : error 017: undefined symbol "layerid" C:\Documents and Settings\Joeri\Bureaublad\samp server\gamemodes\penls.pwn(925 : error 017: undefined symbol "layerid" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |
Originally Posted by joeri55
But what about the layerid and the other one?
|
if(!strcmp(cmd,"/cuff",true)) {
// Declare and initialize variables to hold parameters
new playerToBeCuffed[256], playerCuffedID, index;
playerToBeCuffed = strtok(cmdtext, index);
// Do we have valid parameters? This implementation is much faster than checking the string length of the command.
if(!playerToBeCuffed[0]) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /cuff [Player ID / Part of name]");
// Did they specify id, or name?
if(!IsNumeric(playerToBeCuffed)) {
playerCuffedID = ReturnPlayerID(playerToBeCuffed);
} else playerCuffedID = strval(playerToBeCuffed);
// Inform the player
GameTextForPlayer(id, "~y~hand cuffs!", 2500, 3);
// Toggle the player uncontrollable
TogglePlayerControllable(id, 0);
return true;
}
Originally Posted by joeri55
Thanks samgreen.
I know that my team is 2. Where must I add this line: if (gTeam[playerid] == 2) to make it cop only? |
C:\Documents and Settings\Joeri\Bureaublad\samp server\gamemodes\penls.pwn(19244) : error 017: undefined symbol "IsNumeric"
C:\Documents and Settings\Joeri\Bureaublad\samp server\gamemodes\penls.pwn(19245) : error 017: undefined symbol "ReturnPlayerID"
C:\Documents and Settings\Joeri\Bureaublad\samp server\gamemodes\penls.pwn(19249) : error 017: undefined symbol "id"
C:\Documents and Settings\Joeri\Bureaublad\samp server\gamemodes\penls.pwn(19252) : error 017: undefined symbol "id"
C:\Documents and Settings\Joeri\Bureaublad\samp server\gamemodes\penls.pwn(19246) : warning 204: symbol is assigned a value that is never used: "playerCuffedID"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
C:\Documents and Settings\Joeri\Bureaublad\samp server\gamemodes\penls.pwn(19244) : error 017: undefined symbol "IsNumeric"
C:\Documents and Settings\Joeri\Bureaublad\samp server\gamemodes\penls.pwn(19245) : error 017: undefined symbol "ReturnPlayerID"
C:\Documents and Settings\Joeri\Bureaublad\samp server\gamemodes\penls.pwn(19246) : warning 204: symbol is assigned a value that is never used: "playerCuffedID"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Errors.