Drive By CMD - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Drive By CMD (
/showthread.php?tid=475398)
Drive By CMD -
Gogorakis - 12.11.2013
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!
Re: Drive By CMD -
DobbysGamertag - 12.11.2013
Like this?
Compiles fine.
pawn Код:
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;
}
Re : Drive By CMD -
samp_boy - 12.11.2013
why you don't finish it by yourself
Re: Drive By CMD -
Loot - 12.11.2013
pawn Код:
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;
}