Posts: 386
Threads: 109
Joined: Oct 2010
Reputation:
0
Only one person on the server can use the godcar command now, why's this?
EDIT:Your version didn't work at all O.o
Posts: 484
Threads: 49
Joined: Feb 2011
pawn Code:
new GodMode[MAX_PLAYERS];
//Under OnGameModeInit
SetTimer("AutoR", 2000, true);
//Under your Command Godmode (ON)
GodMode[playerid] = 1;
//Under your Command Godmode (OFF)
GodMode[playerid] = 0;
forward AutoR(playerid);
public AutoR(playerid)
{
if(IsPlayerInAnyVehicle(playerid) && GodMode[playerid] == 1)
{
new vid = GetPlayerVehicleID(playerid);
RepairVehicle(vid);
}
return 1;
}
And also you can make public like this
pawn Code:
public AutoR(playerid)
{
if(IsPlayerInAnyVehicle(playerid) && GodMode[playerid] == 1)
{
new vid = GetPlayerVehicleID(playerid);
new Float:health;
GetVehicleHealth(vid, health);
if(health <999) // or lower....
{
RepairVehicle(vid);
}
}
}