Unknown Command -
NathNathii - 13.04.2013
I created /Cuff & /uncuff but it gives me SERVER: Unknown Command?
Commands
pawn Код:
CMD:uncuff(playerid, params[])
{
if(GetPlayerTeam(playerid) != TEAM_SWAT)
if(GetPlayerTeam(playerid) != TEAM_CIA)
if(GetPlayerTeam(playerid) != TEAM_COP)
return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Only Law Enforcement may use this command!");
new targetid;
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Usage: /uncuff [id]");
if(IsPlayerConnected(targetid))
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInRangeOfPoint(targetid, 5.0, x, y, z))
{
if(!SetPlayerAttachedObject(targetid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000))return SendClientMessage(playerid,-1,"ERROR: The player is not cuffed!");//this will check that if the player is not cuffed and you are trying to apply this cmd,this will send him a error message.
SetPlayerSpecialAction(targetid,SPECIAL_ACTION_NONE);
new str[512];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new target[MAX_PLAYER_NAME];
GetPlayerName(targetid, target, sizeof(target));
format(str, sizeof(str), "You removed %s's cuffs",target);
SendClientMessage(playerid, 0xE01B1B, str);
format(str, sizeof(str), "You have been uncuffed by %s",name);
SendClientMessage(targetid, COLOR_LIGHTBLUE, str);
return 1;
}
}
return 1;
}
CMD:cuff(playerid, params[])
{
if(GetPlayerTeam(playerid) != TEAM_SWAT)
if(GetPlayerTeam(playerid) != TEAM_CIA)
if(GetPlayerTeam(playerid) != TEAM_COP)
return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Only Law Enforcement may use this command!");
new targetid;
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Usage: /cuff [id]");
if(IsPlayerConnected(targetid))
{
if (GetPlayerWantedLevel(playerid < 1)) return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}That player is not wanted!");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInRangeOfPoint(targetid, 5.0, x, y, z))
{
new str[512];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new target[MAX_PLAYER_NAME];
GetPlayerName(targetid, target, sizeof(target));
format(str, sizeof(str), "You did set cuffs on %s!",target);
SendClientMessage(playerid, 0xE01B1B, str);
format(str, sizeof(str), "You have been cuffed by %s",name);
SendClientMessage(targetid, COLOR_LIGHTBLUE, str);
SetPlayerAttachedObject(targetid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000);
SetPlayerSpecialAction(targetid,SPECIAL_ACTION_CUFFED);
return 1;
}
Re: Unknown Command -
Igal-A - 13.04.2013
try
PHP код:
CMD:uncuff(playerid, params[])
{
if(GetPlayerTeam(playerid) != TEAM_SWAT)
if(GetPlayerTeam(playerid) != TEAM_CIA)
if(GetPlayerTeam(playerid) != TEAM_COP)
return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Only Law Enforcement may use this command!");
new targetid;
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Usage: /uncuff [id]");
if(IsPlayerConnected(targetid))
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInRangeOfPoint(targetid, 5.0, x, y, z))
{
if(!SetPlayerAttachedObject(targetid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000))return SendClientMessage(playerid,-1,"ERROR: The player is not cuffed!");//this will check that if the player is not cuffed and you are trying to apply this cmd,this will send him a error message.
SetPlayerSpecialAction(targetid,SPECIAL_ACTION_NONE);
new str[512];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new target[MAX_PLAYER_NAME];
GetPlayerName(targetid, target, sizeof(target));
format(str, sizeof(str), "You removed %s's cuffs",target);
SendClientMessage(playerid, 0xE01B1B, str);
format(str, sizeof(str), "You have been uncuffed by %s",name);
SendClientMessage(targetid, COLOR_LIGHTBLUE, str);
}
}
return 1;
}
Re: Unknown Command -
NathNathii - 13.04.2013
Still the same..
Re: Unknown Command -
kalanerik99 - 13.04.2013
Try this
pawn Код:
CMD:uncuff(playerid, params[])
{
if(GetPlayerTeam(playerid) != TEAM_SWAT)
if(GetPlayerTeam(playerid) != TEAM_CIA)
if(GetPlayerTeam(playerid) != TEAM_COP)
return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Only Law Enforcement may use this command!");
new targetid;
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Usage: /uncuff [id]");
if(IsPlayerConnected(targetid))
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInRangeOfPoint(targetid, 5.0, x, y, z))
{
if(!SetPlayerAttachedObject(targetid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000))return SendClientMessage(playerid,-1,"ERROR: The player is not cuffed!");//this will check that if the player is not cuffed and you are trying to apply this cmd,this will send him a error message.
SetPlayerSpecialAction(targetid,SPECIAL_ACTION_NONE);
new str[512];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new target[MAX_PLAYER_NAME];
GetPlayerName(targetid, target, sizeof(target));
format(str, sizeof(str), "You removed %s's cuffs",target);
SendClientMessage(playerid, 0xE01B1B, str);
format(str, sizeof(str), "You have been uncuffed by %s",name);
SendClientMessage(targetid, COLOR_LIGHTBLUE, str);
return 1;
}
CMD:cuff(playerid, params[])
{
if(GetPlayerTeam(playerid) != TEAM_SWAT)
if(GetPlayerTeam(playerid) != TEAM_CIA)
if(GetPlayerTeam(playerid) != TEAM_COP)
return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Only Law Enforcement may use this command!");
new targetid;
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Usage: /cuff [id]");
if(IsPlayerConnected(targetid))
{
if (GetPlayerWantedLevel(playerid < 1)) return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}That player is not wanted!");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInRangeOfPoint(targetid, 5.0, x, y, z))
{
new str[512];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new target[MAX_PLAYER_NAME];
GetPlayerName(targetid, target, sizeof(target));
format(str, sizeof(str), "You did set cuffs on %s!",target);
SendClientMessage(playerid, 0xE01B1B, str);
format(str, sizeof(str), "You have been cuffed by %s",name);
SendClientMessage(targetid, COLOR_LIGHTBLUE, str);
SetPlayerAttachedObject(targetid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000);
SetPlayerSpecialAction(targetid,SPECIAL_ACTION_CUFFED);
return 1;
}
Re: Unknown Command -
NathNathii - 13.04.2013
Код:
C:\Users\linda\Documents\LVCnR Testing\gamemodes\LVCnR.pwn(312) : warning 217: loose indentation
C:\Users\linda\Documents\LVCnR Testing\gamemodes\LVCnR.pwn(312) : error 029: invalid expression, assumed zero
C:\Users\linda\Documents\LVCnR Testing\gamemodes\LVCnR.pwn(312) : error 017: undefined symbol "cmd_cuff"
C:\Users\linda\Documents\LVCnR Testing\gamemodes\LVCnR.pwn(312) : error 029: invalid expression, assumed zero
C:\Users\linda\Documents\LVCnR Testing\gamemodes\LVCnR.pwn(312) : fatal error 107: too many error messages on one line
Line 312:
pawn Код:
CMD:cuff(playerid, params[])
Re: Unknown Command -
JJB562 - 13.04.2013
Try this code, it's untested but should work.
pawn Код:
CMD:uncuff(playerid, params[])
{
if(GetPlayerTeam(playerid) != TEAM_SWAT)
if(GetPlayerTeam(playerid) != TEAM_CIA)
if(GetPlayerTeam(playerid) != TEAM_COP)
return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Only Law Enforcement may use this command!");
new targetid;
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Usage: /uncuff [id]");
if(IsPlayerConnected(targetid))
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInRangeOfPoint(targetid, 5.0, x, y, z))
{
if(!SetPlayerAttachedObject(targetid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000))return SendClientMessage(playerid,-1,"ERROR: The player is not cuffed!");//this will check that if the player is not cuffed and you are trying to apply this cmd,this will send him a error message.
SetPlayerSpecialAction(targetid,SPECIAL_ACTION_NONE);
new str[512];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new target[MAX_PLAYER_NAME];
GetPlayerName(targetid, target, sizeof(target));
format(str, sizeof(str), "You removed %s's cuffs",target);
SendClientMessage(playerid, 0xE01B1B, str);
format(str, sizeof(str), "You have been uncuffed by %s",name);
SendClientMessage(targetid, COLOR_LIGHTBLUE, str);
}
}
return 1;
}
CMD:cuff(playerid, params[])
{
if(GetPlayerTeam(playerid) != TEAM_SWAT) return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Only Law Enforcement may use this command!");
if(GetPlayerTeam(playerid) != TEAM_CIA) return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Only Law Enforcement may use this command!");
if(GetPlayerTeam(playerid) != TEAM_COP) return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Only Law Enforcement may use this command!");
new targetid;
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Usage: /cuff [id]");
if(IsPlayerConnected(targetid))
{
if (GetPlayerWantedLevel(playerid < 1)) return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}That player is not wanted!");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInRangeOfPoint(targetid, 5.0, x, y, z))
{
new str[512];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new target[MAX_PLAYER_NAME];
GetPlayerName(targetid, target, sizeof(target));
format(str, sizeof(str), "You did set cuffs on %s!",target);
SendClientMessage(playerid, 0xE01B1B, str);
format(str, sizeof(str), "You have been cuffed by %s",name);
SendClientMessage(targetid, COLOR_LIGHTBLUE, str);
SetPlayerAttachedObject(targetid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000);
SetPlayerSpecialAction(targetid,SPECIAL_ACTION_CUFFED);
}
}
return 1;
}
Re: Unknown Command -
NathNathii - 13.04.2013
Thanks, but is it possible to make it so SWAT, COP & CIA can only cuff the people with wanted level 1+?
So they can't cuff theirself or innocent people.
Re: Unknown Command -
JJB562 - 13.04.2013
Change your /cuff command to this:
pawn Код:
CMD:cuff(playerid, params[])
{
if(GetPlayerTeam(playerid) != TEAM_SWAT) return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Only Law Enforcement may use this command!");
if(GetPlayerTeam(playerid) != TEAM_CIA) return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Only Law Enforcement may use this command!");
if(GetPlayerTeam(playerid) != TEAM_COP) return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Only Law Enforcement may use this command!");
new targetid;
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Usage: /cuff [id]");
if(IsPlayerConnected(targetid))
{
// These next two lines will make it so the player cannot cuff themselves, and can only cuff people with
// a wanted level of 1+.
if(GetPlayerWantedLevel(playerid) < 1)) return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}That player is not wanted!");
if(targetid == playerid) return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}You cannot cuff yourself!");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInRangeOfPoint(targetid, 5.0, x, y, z))
{
new str[512];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new target[MAX_PLAYER_NAME];
GetPlayerName(targetid, target, sizeof(target));
format(str, sizeof(str), "You did set cuffs on %s!",target);
SendClientMessage(playerid, 0xE01B1B, str);
format(str, sizeof(str), "You have been cuffed by %s",name);
SendClientMessage(targetid, COLOR_LIGHTBLUE, str);
SetPlayerAttachedObject(targetid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000);
SetPlayerSpecialAction(targetid,SPECIAL_ACTION_CUFFED);
}
}
return 1;
}
Re: Unknown Command -
NathNathii - 13.04.2013
Код:
C:\Users\linda\Documents\LVCnR Testing\gamemodes\LVCnR.pwn(329) : error 029: invalid expression, assumed zero
C:\Users\linda\Documents\LVCnR Testing\gamemodes\LVCnR.pwn(329) : warning 215: expression has no effect
C:\Users\linda\Documents\LVCnR Testing\gamemodes\LVCnR.pwn(329) : error 001: expected token: ";", but found "return"
C:\Users\linda\Documents\LVCnR Testing\gamemodes\LVCnR.pwn(330) : warning 225: unreachable code
Re: Unknown Command -
JJB562 - 13.04.2013
Can you show me the lines 329 and 330?