Block the command if...
#1

This command is respawning a ownable car (only if the car is not in use). I wan't it should send a message if someone is driving the car.. "You vehicle is in use try it later" anyone has idea ?

Quote:

if(strcmp(cmd, "/tc3", true) == 0 || strcmp(cmd, "/tv3", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new player=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
new keycar = PlayerInfo[playerid][pPcarkey3];
if(keycar != 255)
{
if(!unwanted[keycar]) SetVehicleToRespawn(keycar);
}
SendClientMessage(playerid, COLOR_WHITE, "Vehicle respawned");
}
return 1;
}

Reply
#2

pawn Код:
if(strcmp(cmd, "/tc3", true) == 0 || strcmp(cmd, "/tv3", true) == 0)
  {
    if(IsPlayerConnected(playerid))
    {
     for(new player=0; player<MAX_PLAYERS; player++)
      {
        if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
      }
      new keycar = PlayerInfo[playerid][pPcarkey3];
      if(keycar != 255)
     {
      if(!unwanted[keycar]) SetVehicleToRespawn(keycar);
      else SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle is in use try it later");
     }
   }
   return 1;
  }
Reply
#3

Thanks MadeMan it works and if player dont have a ownable car (pPcarkey3) it should block the cmd too and send a msg... "You dont' own a vehicle"
Reply
#4

If he/she respawn the vehicle it should send a msg " You respawned your vehicle" and If he/she dont owns a vehicle it should send a msg "you dont have a vehicle". Please help

Quote:

if(strcmp(cmd, "/tc3", true) == 0 || strcmp(cmd, "/tv3", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new player=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
new keycar = PlayerInfo[playerid][pPcarkey3];
if(keycar != 255)
{
if(!unwanted[keycar]) SetVehicleToRespawn(keycar);
else SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle is in use try it later");
}
}
return 1;
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)