nrg/spawn command
#3

Hi!

I am the person who wrote you the code. I told you that you should put the declaration above OnGameModeInit:
PHP код:
//global (above OnGameModeInit):
new Float:Pos[3],inf[MAX_PLAYERS],nrg[MAX_PLAYERS];
//the public:
public OnPlayerCommandText(playeridcmdtext[])
{
    if(!
strcmp(cmdtext,"/inf",true))
    {
        if(
inf[playerid] == 0)
        {
            
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
            
inf[playerid] = CreateVehicle(411,Pos[0],Pos[1],Pos[2],0,-1,-1,10);
            
PutPlayerInVehicle(playerid,inf[playerid],0);
            
SendClientMessage(playerid,0xFF641AFF,"SERVER: You have Spawned An Infernus.");
            return 
1;
        }
        else if(
inf[playerid] > 0)
        {
            
DestroyVehicle(inf[playerid]);
            
inf[playerid] = 0;
        }
        return 
1;
    }
    if(!
strcmp(cmdtext,"/nrg",true))
    {
        if(
nrg[playerid] == 0)
        {
            
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
            
nrg[playerid] = CreateVehicle(522,Pos[0],Pos[1],Pos[2],0,-1,-1,10);
            
PutPlayerInVehicle(playerid,nrg[playerid],0);
            
SendClientMessage(playerid,0xFF641AFF,"SERVER: You have Spawned A NRG-500.");
            return 
1;
        }
        else if(
nrg[playerid] > 0)
        {
            
DestroyVehicle(nrg[playerid]);
            
nrg[playerid] = 0;
        }
        return 
1;
    }
     return 
0;

Reply


Messages In This Thread
nrg/spawn command - by MonSterLikeHD - 30.03.2016, 14:17
Re: nrg/spawn command - by Vanter - 30.03.2016, 14:19
Re: nrg/spawn command - by Mencent - 30.03.2016, 14:22
Re: nrg/spawn command - by MonSterLikeHD - 30.03.2016, 14:26
Re: nrg/spawn command - by Mencent - 30.03.2016, 14:31
Re: nrg/spawn command - by YouServ - 30.03.2016, 15:27
Re: nrg/spawn command - by MonSterLikeHD - 01.04.2016, 17:46

Forum Jump:


Users browsing this thread: 2 Guest(s)