30.03.2016, 14:22
Hi!
I am the person who wrote you the code. I told you that you should put the declaration above OnGameModeInit:
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(playerid, cmdtext[])
{
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;
}