variables
#3

pawn Код:
#include a_samp
#include zcmd

new Variables[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    Variables[playerid] = 0; //reset the weapon when join the server.
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    Variables[playerid] = 0;//reset the weapon when left the server.
    return 1;
}

CMD:test(playerid, params[])
{
    if(Variables[playerid] == 1) //will enable it and give weapon.
    {
        GivePlayerWeapon(playerid, 24, 100);
        SendClientMessage(playerid, -1, "Variables on");
    }
    else if(Variables[playerid] == 0) //here it will be disable and reset the weapons.
    {
        ResetPlayerWeapons(playerid);
        SendClientMessage(playerid, -1, "Variables off");
    }
    return 1;
}
just an example;
Reply


Messages In This Thread
variables - by Xbowman - 15.08.2012, 17:36
Re : variables - by Naruto_Emilio - 16.08.2012, 00:45
Re: variables - by Devilxz97 - 16.08.2012, 00:55

Forum Jump:


Users browsing this thread: 2 Guest(s)