Car Respawner
#1

Hello everyone i need some help. I want to make a car re spawner for the admins but i`m not sure of tha code i`m suppose to put. Can someone please help me here
Reply
#2

Add this under OnPlayerCommandText
pawn Код:
if(strcmp("/respawn",cmdtext,true) == 0){
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
return 1;
}
Reply
#3

That didn`t work. I put it in the script compiled it, Compiled nicely without errors and warnings tried the commands and nothing respawned.
Reply
#4

BUMP! ^ Please help me. I can`t stand cars all over the place
Reply
#5

Maybe try stiing into a car?
Reply
#6

pawn Код:
if(strcmp("/respawn",cmdtext,true) == 0)
{
  for(new i=0; i<MAX_VEHICLES; i++)
    {
    SetVehicleToRespawn(i);
    SendClientMessage(playerid, 0x00FF00AA, "Vehicles respawned by admin!");
    return 1;
    }
}
There..
Reply
#7

pawn Код:
if(strcmp(cmdtext, "/respawncars", true) == 0)
  {
    if (IsPlayerAdmin(playerid)) // This will check if player is admin..
    {
     for(new i=0;i<MAX_VEHICLES;i++)
     {
       if(IsVehicleOccupied(i) == 0) // If no one isn't in car
       {
         SetVehicleToRespawn(i); //will set vehicle to respawn
        }
     }
     SendClientMessageToAll(COLOR_GREY, "All vehicles respawned succesfully by Admin!"); // Send client message to all
    }
    else
    {
     SendClientMessage(playerid,COLOR_GREY, "You are not allowed to use this command!"); // You will get this if you're not an admin (Rcon one
    }
    return 1;
  }
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)