02.01.2012, 18:54
People were unsure on how to make a simple respawn vehicles command!
So here it is
First you need to ensure you have a admin check.
Second, you want the command line under "OnPlayerCommandText"
so add
// which is your command
Press the "Enter key" then put a bracket
Press the enter key again and press TAB.
Then add your admin check, in my case every level of staff is allowed to respawn vehicles.
[pawn]if(!IsPlayerAdmin[playerid])
Press Enter, then do a
then press enter again and press TAB
and add this line
// selects every vehicle that is ingame vehicleid is defined as "c"
{
then tab
which actually respawns the vehicles
closing bracket }
then you want it to send a message to all players to inform them.
Press enter and add
then add 2 closing brackets.
you should have this
So here it is
pawn Code:
#include <a_samp>
#define COLOR_RED 0xFF0000
#define COLOR_WHITE 0xFFFFFF
#define COLOR_GREY 0xAFAFAFAA
Second, you want the command line under "OnPlayerCommandText"
so add
pawn Code:
if(strcmp("/respawnvehicles", cmdtext, true) == 0)
Press the "Enter key" then put a bracket
pawn Code:
{
Then add your admin check, in my case every level of staff is allowed to respawn vehicles.
[pawn]if(!IsPlayerAdmin[playerid])
Press Enter, then do a
pawn Code:
{
and add this line
pawn Code:
for(new c=0;c<MAX_VEHICLES;c++)
{
then tab
pawn Code:
RespawnVehicle(c);
return 1;
closing bracket }
then you want it to send a message to all players to inform them.
Press enter and add
pawn Code:
SendClientMessageToAll(COLOR_WHITE, "----------------------------------------------------------------------------");
SendClientMessageToAll(COLOR_GREY, "(SS-INFO) Mass car respawn!");
SendClientMessageToAll(COLOR_WHITE, "----------------------------------------------------------------------------");
return 1;
you should have this
pawn Code:
if(strcmp("/respawnvehicles", cmdtext, true) == 0)
{
if(!IsPlayerAdmin[playerid]) // rcon admin
{
for(new c=0;c<MAX_VEHICLES;c++)
{
RespawnVehicle(c);
}
SendClientMessageToAll(COLOR_WHITE, "----------------------------------------------------------------------------");
SendClientMessageToAll(COLOR_GREY, "(SS-INFO) Mass car respawn!");
SendClientMessageToAll(COLOR_WHITE, "----------------------------------------------------------------------------");
return 1;
}
}