PDA

View Full Version : Drive By CMD


Gogorakis
12/11/2013, 09:13 PM
Hello SA:MP,
Can someone finish this CMD?

CMD:driveby(playerid, params[])
{
new HisState;
HisState = GetPlayerState(playerid);
if(IsPlayerInRangeOfPoint(playerid, 4, 1214.5676,-905.8721,42.9207))
{
if(HisState == PLAYER_STATE_DRIVER)
{
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, -1, "Thank you for choosing our services, come again later!");
}
else
{
SendClientMessage(playerid, -1, "You are not driving a car.");
return 1;
}
}
else
{
SendClientMessage(playerid, -1, "You are not at the drive-by order spot.");
return 1;
}
return 1;
}

Please put timer...I mean..When someone times "/driveby" he should wait 15seconds and he cant move... [FREEZE]

THANK YOU!

DobbysGamertag
12/11/2013, 09:18 PM
Like this?

Compiles fine.



CMD:driveby(playerid, params[])
{
new HisState;
HisState = GetPlayerState(playerid);
if(IsPlayerInRangeOfPoint(playerid, 4, 1214.5676,-905.8721,42.9207))
{
if(HisState == PLAYER_STATE_DRIVER)
{
SetTimerEx("Heal_Player",15000,false,"i",playerid);
TogglePlayerControllable(playerid,0);
SendClientMessage(playerid,-1,"Please wait...");
}
else
{
SendClientMessage(playerid, -1, "You are not driving a car.");
return 1;
}
}
else
{
SendClientMessage(playerid, -1, "You are not at the drive-by order spot.");
return 1;
}
return 1;
}
forward public Heal_Player(playerid);
public Heal_Player(playerid)
{
SetPlayerHealth(playerid,100.0);
TogglePlayerControllable(playerid,1);
return 1;
}

samp_boy
12/11/2013, 09:19 PM
why you don't finish it by yourself

Loot
12/11/2013, 09:21 PM
CMD:driveby(playerid, params[])
{
new HisState;
HisState = GetPlayerState(playerid);
if(IsPlayerInRangeOfPoint(playerid, 4, 1214.5676,-905.8721,42.9207))
{
if(HisState == PLAYER_STATE_DRIVER)
{
FreezeDriver(playerid);
SendClientMessage(playerid,-1,"Please wait...");
}
else
{
SendClientMessage(playerid, -1, "You are not driving a car.");
return 1;
}
}
else
{
SendClientMessage(playerid, -1, "You are not at the drive-by order spot.");
return 1;
}
return 1;
}

FreezeDriver(playerid)
{
SetTimerEx("FreezeTimer", 15_000, false, "i", playerid);
return TogglePlayerControllable(playerid, 0);
}

forward FreezeTimer(playerid);
public FreezeTimer(playerid)
{
TogglePlayerControllable(playerid, 1);
return 1;
}