14.12.2010, 05:00
The spectating part works, but when you type /spec for another player it keeps flickering back and changing players at random. Also when a person types /specoff your screen flickers and custom made objects reload them selfs causing yourself to fall through.
Also, what kind of functions would i use to make it scroll through players when they press the left mouse button.
Thanks in advance.
Also, what kind of functions would i use to make it scroll through players when they press the left mouse button.
Thanks in advance.
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);
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);
if(IsPlayerInAnyVehicle(id)) {
PlayerSpectateVehicle(playerid, GetPlayerVehicleID(id));
IsIn[playerid] = CAR;
}
else {
PlayerSpectatePlayer(playerid, id);
IsIn[playerid] = ONFOOT;
}
}
}
}
return 1;
}
command(specoff,playerid, params[])
{
if(GetPlayerAdmin(playerid) < 1) return SendBlockedAdminCommand(playerid, 1);
#pragma unused params
TogglePlayerSpectating(playerid, 0);
return 1;
}