On player enter checkpoint - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: On player enter checkpoint (
/showthread.php?tid=131790)
On player enter checkpoint -
xxjackoxx - 05.03.2010
Hello ,
can anyone provide a example or explain if i can make it so when a checkpoint in a certain spot is entered and a person is in a car , they type /destroy and the car is removed/destroyed.
I assume someone out there can help.
Re: On player enter checkpoint -
xxjackoxx - 05.03.2010
Please.
Re: On player enter checkpoint -
[LSR]State_Trooper - 05.03.2010
Код:
[ pawno code]public OnPlayerEnterCheckpoint(playerid)
{
new string[256];
switch(getCheckpointType(playerid))
{
case CP_HOSPITALin:
{
if(GetPlayerVirtualWorld(playerid) == 1) { // LS MARKET
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,1177.1379,-1325.4160,14.0559);
SendClientMessage(playerid,COLOR_YELLOW,"You have exited All Saints General Hospital.");
SetPlayerFacingAngle(playerid,271.3165);
SetPlayerVirtualWorld(playerid,0);
Thats an exapmle of a CP. As for your command, Its impossible to use a cmd on a Cp
Re: On player enter checkpoint -
bajskorv123 - 05.03.2010
Quote:
Originally Posted by [LSR
State_Trooper ]
Thats an exapmle of a CP. As for your command, Its impossible to use a cmd on a Cp
|
https://sampwiki.blast.hk/wiki/IsPlayerInCheckpoint
Here is the command for xxjackoxx
pawn Код:
if(strcmp(cmdtext, "/destroy", true)==0)
{
if(IsPlayerInCheckpoint(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
DestroyVehicle(GetPlayerVehicleID(playerid));
}
else
{
SendClientMessage(playerid, red, "Error: You need to be in a vehicle to destroy it!");
}
}
else
{
SendClientMessage(playerid, red, "Error: You are not in the checkpoint!");
}
return 1;
}
Re: On player enter checkpoint -
xxjackoxx - 05.03.2010
thankyou!