Slap when car is for another factions
#6

Код:
//add this on top of the script under other new/static statements
new SlapCD[MAX_PLAYERS];
new slapped[MAX_PLAYERS];
//after setting players position add this
TogglePlayerControllable(playerid, false);
SlapCD[playerid] = gettime() + 4;
slapped[playerid] = 1;
//under OnPlayerUpdate:
if(SlapCD[playerid] <= gettime() && slapped[playerid] == 1)
{
    TogglePlayerControllable(playerid, true);
    slapped[playerid] = 0;
}
//Add this under OnPlayerConnect:
slapped[playerid] = 0;
SlapCD[playerid] = 0;
That SlapCD thing works like a timer without using a timer so it doesn't use many resources like the timer does.

Rep if I helped
Reply


Messages In This Thread
Slap when car is for another factions - by marshmallow - 28.05.2018, 06:03
Re: Slap when car is for another factions - by andrejc999 - 28.05.2018, 06:07
Re: Slap when car is for another factions - by marshmallow - 28.05.2018, 06:14
Re: Slap when car is for another factions - by andrejc999 - 28.05.2018, 06:42
Re: Slap when car is for another factions - by marshmallow - 28.05.2018, 06:55
Re: Slap when car is for another factions - by andrejc999 - 28.05.2018, 07:11

Forum Jump:


Users browsing this thread: 1 Guest(s)