08.11.2009, 17:51
Hello,
I've made a /vgod on command which works perfect!
here is the code:
Well,The problem is,That i didn't get how to make a /vgod off command.
So I've tried making something like that:
But,I've noticed half of the objects are gone in the game.
So,I went to a map on my server,A Hugejump,With /vgod on,all objects appeared and the /vgod on worked perfect!.
Then i've tried making the same hugejump with /Vgod off,And half of the objects are gone again..
So there's a problem with the /Vgod off command.
May someone fix it?
Thanks in advance.
I've made a /vgod on command which works perfect!
here is the code:
pawn Код:
forward autofixtimer(playerid);
#include <a_samp>
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/carfix on", cmdtext, true, 9) == 0)
{
new Float:health;
new veh;
veh = GetPlayerVehicleID(playerid);
GetVehicleHealth(veh, health);
if(health <500) SetVehicleHealth(veh,1000);
GameTextForPlayer(playerid,"~w~Auto Car Fix ~g~On!",1000,5);
SetTimer("autofixtimer",3000,1);
return 1;
}
return 0;
}
public autofixtimer(playerid)
{
new Float:health;
new veh;
veh = GetPlayerVehicleID(playerid);
GetVehicleHealth(veh, health);
if(health <500) SetVehicleHealth(veh,1000);
return 1;
}
So I've tried making something like that:
pawn Код:
if (strcmp("/vgod off", cmdtext, true, 10) == 0)
{
KillTimer(autofixtimer(playerid));
GameTextForPlayer(playerid,"~w~vgod ~r~Off!",1000,5);
return 1;
}
So,I went to a map on my server,A Hugejump,With /vgod on,all objects appeared and the /vgod on worked perfect!.
Then i've tried making the same hugejump with /Vgod off,And half of the objects are gone again..
So there's a problem with the /Vgod off command.
May someone fix it?
Thanks in advance.