02.01.2014, 13:26
The problem is that when someone comes into the store is corrupted
What is the solution؟

What is the solution؟

PHP код:
CMD:spec(playerid, params[])
{
new id;
CL(playerid);
if(pInfo[playerid][Admin] >= 5)
{
if(sscanf(params, "u", id))
{
SendClientMessage(playerid, COLOR_RED, "USAGE: /spec [playerid]");
SendClientMessage(playerid, COLOR_ORANGE, "Function: Spectates the specified player (Note there is no current next or prev spec)");
return 1;
}
if(id == playerid) return Error(playerid, 1);
if(id == INVALID_PLAYER_ID) return Error(playerid, 0);
if(pInfo[playerid][Admin] < pInfo[id][Admin]) return Error(playerid, 8);
if(IsSpecing[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are already specing someone");
if(GPS[playerid] != -1) return SendClientMessage(playerid, COLOR_RED, "ERROR: Disable the GPS first! (/gpsoff)");
if(IsInCameraMode[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "ERROR: Turn off the Camera Mode first!");
if(ongps[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "ERROR: Turn off your GPS destination first!");
GetPlayerPos(playerid, SpecX[playerid], SpecY[playerid], SpecZ[playerid]);
Inter[playerid] = GetPlayerInterior(playerid);
vWorld[playerid] = GetPlayerVirtualWorld(playerid);
TogglePlayerSpectating(playerid, true);
if(IsPlayerInAnyVehicle(id))
{
if(GetPlayerInterior(id) > 0)
{
SetPlayerInterior(playerid, GetPlayerInterior(id));
}
if(GetPlayerVirtualWorld(id) > 0)
{
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
}
PlayerSpectateVehicle(playerid, GetPlayerVehicleID(id));
}
else
{
if(GetPlayerInterior(id) > 0)
{
SetPlayerInterior(playerid, GetPlayerInterior(id));
}
if(GetPlayerVirtualWorld(id) > 0)
{
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
}
PlayerSpectatePlayer(playerid, id);
}
format(String, sizeof(String), "You have started to spectate %s(ID:%d)", GetName(id), id);
SendClientMessage(playerid, COLOR_YELLOW, String);
IsSpecing[playerid] = 1;
IsBeingSpeced[id] = 1;
spectatorid[playerid] = id;
SendCommandToAdmins(playerid,"SPEC");
new Float:hp, Float:ar;
GetPlayerHealth(id, hp);
GetPlayerArmour(id, ar);
new string[256];
format(string, 128, "~w~- %s(%d) -~n~~n~~y~Health: ~w~%0.1f ~l~- ~y~Armour: ~w~%0.1f ~l~- ~y~Money: ~w~$%d~n~~n~~r~< Sprint - Jump >", GetName(id),id,hp,ar,GetPlayerMoney(id));
TextDrawSetString(GpsTD[playerid], string);
TextDrawShowForPlayer(playerid,GpsTD[playerid]);
}
else return Error(playerid, 3);
return 1;
}
CMD:specoff(playerid, params[])
{
CL(playerid);
if(pInfo[playerid][Admin] >= 1)
{
if(IsSpecing[playerid] == 0) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not spectating anyone");
TogglePlayerSpectating(playerid, 0);
IsSpecing[playerid] = 0;
SendCommandToAdmins(playerid,"SPECOFF");
TextDrawHideForPlayer(playerid,GpsTD[playerid]);
}
else return Error(playerid, 3);
return 1;
}