30.01.2010, 20:22
where is incorrect on my command? Because this send a message "Unknown Command" in server...
the command works. But it sends "Unknown command" after "Spec On!"
the command works. But it sends "Unknown command" after "Spec On!"
pawn Код:
dcmd_spec(playerid,params[])
{
if(IsPlayerAdmin(playerid))
{
if(!strlen(params) || !IsNumeric(params)) return
SendClientMessage(playerid, LIGHTBLUE2, "Usage: /lspec [PlayerID]") &&
SendClientMessage(playerid, orange, "Function: Will spec a specified Player");
new specid = strval(params);
if(IsPlayerConnected(specplayerid) && specid != INVALID_PLAYER_ID)
{
if(specid == playerid)
return SendClientMessage(playerid, red, "ERROR");
if(GetPlayerState(specid) == PLAYER_STATE_SPECTATING && INFO[specid][ID] != INVALID_PLAYER_ID)
return SendClientMessage(playerid, red, "ERROR");
if(GetPlayerState(specid) != 2 && GetPlayerState(specplayerid) != 1 && GetPlayerState(specplayerid) != 3)
return SendClientMessage(playerid, red, "ERROR");
if( (INFO[specid][POSI] != svInfo[ADM]) || (INFO[specid][POSI] == svInfo[ADM] && INFO[playerid][POSI] == svInfo[ADM]))
{
LoadSpec(playerid, specid);
GetPlayerPos(playerid,POSITION[playerid][0],POSITION[playerid][1],POSITION[playerid][2]);
GetPlayerFacingAngle(playerid,POSITION[playerid][3]);
return SendClientMessage(playerid,blue,"Spec ON!");
}
}
}
}