/spec help.
#2

Show us the "SpecUpdate" function.

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;
}
Reply


Messages In This Thread
/spec help. - by Haydz - 14.12.2010, 05:00
Re: /spec help. - by [NWA]Hannes - 14.12.2010, 07:11
Re: /spec help. - by Haydz - 14.12.2010, 07:31
Re: /spec help. - by TheInnocentOne - 14.12.2010, 07:50
Re: /spec help. - by Haydz - 16.12.2010, 06:14

Forum Jump:


Users browsing this thread: 2 Guest(s)