[HELP] Checkpoint , command
#1

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;
}
Reply
#2

use this
https://sampwiki.blast.hk/wiki/IsPlayerInCheckpoint
Reply
#3

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.
Reply
#4

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;
}
Reply
#5

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....
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)