Create cp on command?
#1

Hey guys i got this command that should make a command and when you enter it, it should destroy itself and give some money?
How do i do this?
pawn Код:
COMMAND:startmech(playerid, params[]) // work at mechanic and receive $180
{
  if(!IsPlayerInRangeOfPoint(playerid, 30.0,2451.0056,-2118.1301,13.5469))return SendClientMessage(playerid, 0xE0313AFF, "(( [Mechanic]You are not at the mechanic HQ! ))");
  if(IsPlayerInVehicle(playerid, 525)) return SendClientMessage(playerid, 0xE0313AFF, "(( [Mechanic] You are not in a mechanics vehicle! ))");
  SendClientMessage(playerid, 0x3524C9FF, "(( [Mechanic] Deliver the tires to the checkpoint and receive your paycheck! ))");
  return 1;
}
Reply
#2

On the command create a variable and set it to true and the checkpoint (SetPlayerRaceCheckpoint)
When he enters the checkpoint (OnPlayerEnterRaceCheckpoint) check if the variable you created before is true and do the following:
DisablePlayerRaceCheckpoint and set that variable to false. Don't forget to reset them in OnPlayerConnect.
Reply
#3

Hmm if you want to use a checkpoint it better be with streamer, i'll give you a code which uses Pick ups
Put this on the top of your script
pawn Код:
new TiresPick;
The command
pawn Код:
COMMAND:startmech(playerid, params[]) // work at mechanic and receive $180
{
  if(!IsPlayerInRangeOfPoint(playerid, 30.0,2451.0056,-2118.1301,13.5469))return SendClientMessage(playerid, 0xE0313AFF, "(( [Mechanic]You are not at the mechanic HQ! ))");
  if(IsPlayerInVehicle(playerid, 525)) return SendClientMessage(playerid, 0xE0313AFF, "(( [Mechanic] You are not in a mechanics vehicle! ))");
  SendClientMessage(playerid, 0x3524C9FF, "(( [Mechanic] Deliver the tires to the checkpoint and receive your paycheck! ))");
    TiresPick = CreatePickup(1274, 0, 2451.0056,-2118.1301,13.5469);//the pickup
  return 1;
}
When player picks up the pickup
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == TiresPick)
    {
    GivePlayerMoney(playerid,3000);//the cash.
    DestroyPickup(Tirespick);
    }
return 1;
}
Reply
#4

pawn Код:
I can't see any problem with that but check maybe you have unfinde symbol
Reply
#5

Quote:
Originally Posted by Jack_Ryder
Посмотреть сообщение
pawn Код:
I can't see any problem with that but check maybe you have unfinde symbol
What?

He is asking how to do it with checkpoints, nothing is wrong with his code until now.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)