Can someone get this command
#2

Try this


pawn Код:
#include <a_samp>

//#define INFINITY (Float:1000000)  Lol infinity. lolol
#define COLOR_MAGENTA 0xFF00FFFF

new GodCarMode[MAX_PLAYERS];

public OnFilterScriptInit()
{
    SetTimer("GodCar", 2000, 1);
    return 1;
}

public OnPlayerConnect(playerid)
{
    GodCarMode[playerid] = 0;
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{

if(strcmp(cmdtext, "/godcar", true) == 0)
{
    new playerState = GetPlayerState(playerid);
    if (playerState == PLAYER_STATE_PASSENGER || playerState == PLAYER_STATE_DRIVER)
    {
        if(IsPlayerAdmin(playerid))
        {
            if(GodCarMode[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_MAGENTA, "GOD CAR MODE ON");
                GodCarMode[playerid] = 1;
            }
            else if(GodCarMode[playerid] == 1)
            {
                SendClientMessage(playerid, COLOR_MAGENTA, "GOD CAR MODE OFF");
                SetVehicleHealth(playerid, 1000);
                GodCarMode[playerid] = 0;
            }
            }
            else
            {
                SendClientMessage(playerid, COLOR_MAGENTA, "You are not an admin!");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_MAGENTA, "You are not in any vehicle");
        }
    return 1;
    }
return 0;
}

forward GodCar();
public GodCar()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && GodCarMode[i] == 1 && IsPlayerInAnyVehicle(i))
        {
            SetVehicleHealth(GetPlayerVehicleID(i),10000);
        }
    }
}
(I did not test, just made and compiled)

If doesnt work, post back.
Reply


Messages In This Thread
Can someone get this command - by willsuckformoney - 17.07.2010, 15:44
Re: Can someone get this command - by DiddyBop - 17.07.2010, 16:48
Re: Can someone get this command - by willsuckformoney - 17.07.2010, 16:50
Re: Can someone get this command - by DiddyBop - 17.07.2010, 16:56

Forum Jump:


Users browsing this thread: 1 Guest(s)