Jump to content
  • 0

/vrespawn


bogdan.trial

Question

Salut. Trec direct la subiect. Uite eu scriptu asta il folosesc sa dau spawn la masini

COMMAND:veh(playerid,params[])
{
	#if ALLOW_VEH == false
		return SendClientMessage(playerid,color_red,"Sorry! This feature has been disabled.");
	#else
    if(PlayerInfo[playerid][Level] < 2) return SendClientMessage(playerid,color_red,"You have no permission to use this command!");
	new vehicle[32],c1 = -1,c2 = -1;
	if(sscanf(params,"s[24]",vehicle)) return SendClientMessage(playerid,color_red,"USAGE: /veh [vehiclename] [color1] [color2]");
    sscanf(params,"s[24]ii",vehicle,c1,c2);
    new model = GetVehicleModelIdByName(vehicle);
    if(model == 0) return  SendClientMessage(playerid,color_red,"Sorry! Cannot find a vehicle with your entered vehiclename.");
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
	AddStaticVehicleEx(model,x+5,y,z,0,c1,c2,-1);
	SendClientMessageEx(playerid,color_orange,"sss","You succesfully spawned a ",vehicle," !");
	printf("%s has spawned a %s.",PlayerInfo[playerid][Username],vehicle);
	return 1;
	#endif
}
Si azi am facut /vrespawn-ul dar cand incerc sa dau respawn la masini imi tot apar inapoi alea create de mine(/veh).
COMMAND:vrespawn(playerid,params[])
{
	if(PlayerInfo[playerid][Level] < 1) return SendClientMessage(playerid,color_red,"You have no permission to use this command!");
 	{
  		for(new iPlayer;iPlayer<MAX_PLAYERS;iPlayer++)
		if(IsPlayerInAnyVehicle(iPlayer) == 1)
     	{
      		RemovePlayerFromVehicle(iPlayer);
      		for(new i;i<MAX_VEHICLES;i++)
        	SetVehicleToRespawn(i);
         	return 1;
      	}
       	for(new iPlayer;iPlayer<MAX_PLAYERS;iPlayer++)
        if(IsPlayerInAnyVehicle(iPlayer) == 0)
        {
        	for(new i;i<MAX_VEHICLES;i++)
         	SetVehicleToRespawn(i);
       	}
   	}
  	return 1;
}

signature.php?bg=000000&text=FFFFFF&border=a0a0a0&ip=176.31.142.87&port=7777&bg_image=
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Pai cele create cu /veh dispar doar la restart!

Daca vrei sa dai repsawn la toate masinile dai /rac(respawn allcars)

[pawn]if(strcmp(cmd, "/respawnallcars", true) == 0 || strcmp(cmd, "/rac", true) == 0) //

{

    if(IsPlayerConnected(playerid))

    {

        if(PlayerInfo[playerid][pAdmin] < 1337)

{

    SendClientMessage(playerid, COLOR_GRAD1, "  you are not authorized to use that command!");

    return 1;

}

new bool:unwanted[CAR_AMOUNT];

for(new player=0; player<MAX_PLAYERS; player++)

    {

            if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }

    }

for(new car = 1; car <= 268; car++)

{

if(!unwanted[car]) SetVehicleToRespawn(car);

}

GetPlayerName(playerid, sendername, sizeof(sendername));

format(string, sizeof(string), "* All unused cars respawned by %s.", sendername);

BroadCast(COLOR_1RED,string);

}

return 1;

}[/pawn]

Daca vrei sa resapwnezi o masina anume si doar pe accea dai /rtc(respawn this car)

[pawn]if(strcmp(cmd, "/respawnthiscar", true) == 0 || strcmp(cmd, "/rtc", true) == 0) //

{

    if(IsPlayerConnected(playerid))

    {

        if(PlayerInfo[playerid][pAdmin] < 2 )

{

    SendClientMessage(playerid, COLOR_GRAD1, "  you are not authorized to use that command!");

    return 1;

}

if(IsPlayerInAnyVehicle(playerid))

{

    GetPlayerName(playerid, sendername, sizeof(sendername));

    format(string, 256, "AdmWarning: Admin %s has just respawned vehicle id %d.",sendername,GetPlayerVehicleID(playerid));

ABroadCast(COLOR_YELLOW,string,1);

    SetVehicleToRespawn(GetPlayerVehicleID(playerid));

  RemovePlayerFromVehicle(playerid);

    SendClientMessage(playerid, COLOR_GREY, "  Vehicle Respawned !");

  }

}

return 1;

}[/pawn]

Dar masinile create cu /veh dispar numai la RESTART! /rcon login parola si apoi /rcon gmx!

Salut,Alex!

rszadc33936a6e246e39ea2.png
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.