Auto CarFix
#1

Hello everyone, i am making a new gamemode, but i want add a Auto Car Fix, when admin enter on duty.

Код:
if(PlayerInfo[playerid][OnDuty] == 1)
Can you guys help me? Thanks
Reply
#2

PHP код:
if(PlayerInfo[playerid][OnDuty] == 1)
{
    
ReapairVehicle(GetPlayerVehicleID(playerid));

Pretty easy ... use the wiki next time, ****** or try thinking for yourself.

If you meant automatically repair it, as soon as it gets damage, you might just want to use OnPlayerUpdate or a player timer
Reply
#3

FFS.....Why making trillions of thread an not using the search forums option on topics which are already there....
I personally suggest open ****** it's a search engine and will provide you every info with example and everything......
Please next time do some research...
Reply
#4

Quote:
Originally Posted by princejeet1510
Посмотреть сообщение
FFS.....Why making trillions of thread an not using the search forums option on topics which are already there....
I personally suggest open ****** it's a search engine and will provide you every info with example and everything......
Please next time do some research...
Yes, buttt.... I just found useles topics. And i want Auto CarFix when it get damage, i found one with OnPlayerUpdate but that topic is down XD anyway, Thanks.
Reply
#5

Intresting, maybe you can try this :

PHP код:
new repairtimer[MAX_PLAYERS];
forward AutoRepair(playerid);
public 
AutoRepair(playerid);
{
    
RepairVehicle(GetPlayerVehicleID(playerid));
    return 
1;
}
public 
OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        if(
PlayerInfo[playerid][OnDuty] == 1)
        {
            
repairtimer[playerid] = SetTimerEx("AutoRepair"10001"u"playerid);
        }
    }
    if(
GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
    {
        if(
PlayerInfo[playerid][OnDuty] == 1)
        {
            
KillTimer(repairtimer[playerid]);
        }
    }
    return 
1;

I hope this will help you
Reply
#6

Quote:
Originally Posted by haikalbintang
Посмотреть сообщение
Intresting, maybe you can try this :

PHP код:
new repairtimer[MAX_PLAYERS];
forward AutoRepair(playerid);
public 
AutoRepair(playerid);
{
    
RepairVehicle(GetPlayerVehicleID(playerid));
    return 
1;
}
public 
OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        if(
PlayerInfo[playerid][OnDuty] == 1)
        {
            
repairtimer[playerid] = SetTimerEx("AutoRepair"10001"u"playerid);
        }
    }
    if(
GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
    {
        if(
PlayerInfo[playerid][OnDuty] == 1)
        {
            
KillTimer(repairtimer[playerid]);
        }
    }
    return 
1;

I hope this will help you
Thanks mate!! You really helped me. Take your +REP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)