[HELP] Checkpoint , command - 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: [HELP] Checkpoint , command (
/showthread.php?tid=132278)
[HELP] Checkpoint , command -
xxjackoxx - 07.03.2010
Hi ,
I have setup a checkpoint to which when someone enters it sends clientmessage . The message tells the person to use /destroycar , but how can i make it so that you have to be in that checkpoint for the command to work.
An example would be great.
Here is the current command
Код:
if(!strcmp("/destroycar", cmdtext, true))
{
if(gTeam[playerid] != TEAM_STAGE25) {
SendClientMessage(playerid,0xFFFFFFAA,"You are not part of the team!");
return 1;
}
DestroyVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid,0xFFFFFFAA," You are a worker , The car has been destroyed");
return 1;
}
Re: [HELP] Checkpoint , command -
cessil - 07.03.2010
use this
https://sampwiki.blast.hk/wiki/IsPlayerInCheckpoint
Re: [HELP] Checkpoint , command -
sidhu123 - 07.03.2010
It'd be nice if you could research... There's many topics like this. USE SEARCH!
Since I'm so nice..
You can't tell a command to do something if you've closed it. Your missing an "else" in your command.
It'd also be nice if you could INDENT your code.
Re: [HELP] Checkpoint , command -
Joe Staff - 07.03.2010

No 'else' needed, not in his code, nor mine.
pawn Код:
if(!strcmp("/destroycar", cmdtext, true))
{
if(!IsPlayerInCheckpoint(playerid))return SendClientMessage(playerid,0xFFFFFFAA,""This is not the place to do that.");
if(gTeam[playerid] != TEAM_STAGE25)return SendClientMessage(playerid,0xFFFFFFAA,"You are not part of the team!");
DestroyVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid,0xFFFFFFAA," You are a worker , The car has been destroyed");
return 1;
}
Re: [HELP] Checkpoint , command -
jamesbond007 - 07.03.2010
Quote:
Originally Posted by [SAP
Sidhu ]
It'd be nice if you could research... There's many topics like this. USE SEARCH!
Since I'm so nice..
You can't tell a command to do something if you've closed it. Your missing an "else" in your command.
It'd also be nice if you could INDENT your code.
|
pwned....
Re: [HELP] Checkpoint , command -
LVFDM - 07.03.2010
Quote:
Originally Posted by jamesbond007
Quote:
Originally Posted by [SAP
Sidhu ]
It'd be nice if you could research... There's many topics like this. USE SEARCH!
Since I'm so nice..
You can't tell a command to do something if you've closed it. Your missing an "else" in your command.
It'd also be nice if you could INDENT your code.
|
pwned....
|
No, he was wrong about needing an "else", also indentation isn't much of a worry on a forum if it's a small peice of code. & you just looked like an idiot.