06.08.2012, 11:50
pawn Код:
YCMD:specoff(playerid, params[])
{
if(PlayerInfo[playerid][Admin] >= 1)
{
TogglePlayerSpectating(playerid, 0);
}
return 1;
}
![confused](images/smilies/confused.gif)
without using it like this
pawn Код:
if(strcmp(params, "off") == 0)
pawn Код:
YCMD:specoff(playerid, params[])
{
if(PlayerInfo[playerid][Admin] >= 1)
{
if(PlayerSpectating[playerid] == 0) return SendClientMessage(playerid, COLOR_WHITE, "You are not spectating anyone.");
{
TogglePlayerSpectating(playerid, 0);
SetPlayerPos(playerid, PlayerInfo[playerid][sPosX], PlayerInfo[playerid][sPosY], PlayerInfo[playerid][sPosZ]);
SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
SetPlayerArmour(playerid, PlayerInfo[playerid][sArmor]);
SetPlayerHealth(playerid, PlayerInfo[playerid][sHealth]);
SetPlayerFacingAngle(playerid, PlayerInfo[playerid][sPosA]);
SendClientMessage(playerid, COLOR_WHITE, "You are no longer spectating.");
PlayerSpectating[playerid] = 0;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /spec [Part of Name/Player ID/off]");
}
}
return 1;
}