14.12.2010, 07:11
Show us the "SpecUpdate" function.
EDIT: Try this.
EDIT: Try this.
pawn Код:
command(spec, playerid, params[])
{
if(GetPlayerAdmin(playerid) < 1) return SendBlockedAdminCommand(playerid, 1);
new id;
if(!strlen(params)) return SendClientMessage(playerid,0xFF0000AA, "USAGE: /Spec [ID]");
{
id = strval(params);
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000AA, "Player not connected.");
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFF0000AA, "You are not admin!");
{
TogglePlayerSpectating(playerid, 1);
SpecTimer[playerid] = SetTimerEx("SpecUpdate", 3000, true, "ii", playerid, id);
if(IsPlayerInAnyVehicle(id))
{
PlayerSpectateVehicle(playerid, GetPlayerVehicleID(id));
IsIn[playerid] = CAR;
}
else
{
PlayerSpectatePlayer(playerid, id);
IsIn[playerid] = ONFOOT;
}
new string[50];
format(string, sizeof(string), "Money: %d", GetPlayerMoney(id));
GameTextForPlayer(playerid, string, 10000, 6);
SpecTimer[playerid] = SetTimerEx("SpecUpdate", 3000, true, "ii", playerid, id);
}
}
}
return 1;
}
command(specoff,playerid, params[])
{
#pragma unused params
if(GetPlayerAdmin(playerid) < 1) return SendBlockedAdminCommand(playerid, 1);
TogglePlayerSpectating(playerid, 0);
SpawnPlayer(playerid);
return 1;
}