10.05.2015, 12:39
i don't use crashdetect.
pawn Код:
CMD:spec(playerid, params[])
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_WHITE, "You need to login first.");
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new id,giveplayer[25],string[100];
if(sscanf(params, "u", id)) return SCM(playerid,COLOR_WHITE,"Syntax:{FFFFFF} /spec <Name/Playerid>");
{
if(IsPlayerConnected(id))
{
if(id != INVALID_PLAYER_ID)
{
Spectate[playerid] = id;
new Float:health;
new playersip[180];
GetPlayerHealthEx(Spectate[playerid], health);
GetPlayerIp(Spectate[playerid],playersip,sizeof(playersip));
GetPlayerName(Spectate[playerid], giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "- Player Info: Name: %s | Heal: %.2f | Location: %s | IP: %s | Level: %d | Wanted: %d -",giveplayer,health,GetPlayerZone(playerid),playersip,PlayerInfo[playerid][pLevel],PlayerInfo[playerid][pWantedLevel]);
SendClientMessage(playerid, COLOR_IN2, string);
TogglePlayerSpectating(playerid, 1);
if(IsPlayerInAnyVehicle(Spectate[playerid]))
{
new carid = GetPlayerVehicleID(Spectate[playerid]);
PlayerSpectateVehicle(playerid, carid);
}
else
{
PlayerSpectatePlayer(playerid, Spectate[playerid]);
}
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: Player not connected.");
}
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, AdminOnly);
return 1;
}
}
return 1;
}