Jump to content

cum fac ca masinile pers. sa fie spawnate pe svr?


justadream.rs
 Share

Recommended Posts

Salut

Am un gamemode unde mașinile personale trebuie să fie spawnate cu comanda /vehspawn. Cum fac să fie spawnate permanent pe server ? Pe server poți deține maxim 4 mașini și eu aș vrea să fie maxim 7.

Nu am cine știe ce cunoștințe în limbajul pawno.. sper că mă ajutați voi

 

 

 

Link to comment
Share on other sites

sincer.. nu găsesc nimic legat de destroyvehicle la onplayerconnect

iar la onplayerdisconnect am găsit doar asta 

		if(CP[playerid] == 44) {
			new engine,lights,alarm,doors,bonnet,boot,objective;
			if(JobCars[playerid] != 0) {
				GetVehicleParamsEx(JobCars[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
				SetVehicleParamsEx(JobCars[playerid],engine,lights,alarm,0,bonnet,boot,objective);
				DestroyVehicle(JobCars[playerid]);
				JobCars[playerid] = 0;
			}

iar comanda /vehspawn

 

CMD:vehspawn(playerid, params[])
{
	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
	new x_nr[50],getcarid = GetPlayerVehicleID(playerid),string[256];
	if(sscanf(params, "s[50]",x_nr)) return SCM(playerid,COLOR_WHITE,"{B8DBFF}Syntax: /vehspawn <1-4> or <tut> for tutorial car");
	if(getcarid != personalcar[playerid]) return SCM(playerid,COLOR_WHITE,"{FFB870}You are not in your car.");
	if(strcmp(x_nr,"1",true) == 0)
	{
	    if(PlayerInfo[playerid][pPcarkey] == 0) return SCM(playerid,COLOR_WHITE,"{FFB870}You do not own a car.");
	    if(OwnedVeh(getcarid) == PlayerInfo[playerid][pPcarkey]) return SCM(playerid,COLOR_WHITE,"{FFB870}You already have car spawned.");
	    if(personalcar[playerid] != 0)
		{
			if(CarInfo[OwnedVeh(personalcar[playerid])][cNeon] != 0)
			{
			    DestroyObject(Neon1[personalcar[playerid]]);
			    DestroyObject(Neon2[personalcar[playerid]]);
			    Neon1[personalcar[playerid]] = 0;
			    Neon2[personalcar[playerid]] = 0;
			}
		    vUpdate(OwnedVeh(personalcar[playerid]), cKMx);
			DestroyVehicle(personalcar[playerid]);
			OwnedVeh(personalcar[playerid]) = 0;
			personalcar[playerid] = 0;
		}
Link to comment
Share on other sites

 

sincer.. nu găsesc nimic legat de destroyvehicle la onplayerconnect

iar la onplayerdisconnect am găsit doar asta 

		if(CP[playerid] == 44) {
			new engine,lights,alarm,doors,bonnet,boot,objective;
			if(JobCars[playerid] != 0) {
				GetVehicleParamsEx(JobCars[playerid],engine,lights,alarm,doors,bonnet,boot,objective);
				SetVehicleParamsEx(JobCars[playerid],engine,lights,alarm,0,bonnet,boot,objective);
				DestroyVehicle(JobCars[playerid]);
				JobCars[playerid] = 0;
			}

iar comanda /vehspawn

 

CMD:vehspawn(playerid, params[])
{
	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
	new x_nr[50],getcarid = GetPlayerVehicleID(playerid),string[256];
	if(sscanf(params, "s[50]",x_nr)) return SCM(playerid,COLOR_WHITE,"{B8DBFF}Syntax: /vehspawn <1-4> or <tut> for tutorial car");
	if(getcarid != personalcar[playerid]) return SCM(playerid,COLOR_WHITE,"{FFB870}You are not in your car.");
	if(strcmp(x_nr,"1",true) == 0)
	{
	    if(PlayerInfo[playerid][pPcarkey] == 0) return SCM(playerid,COLOR_WHITE,"{FFB870}You do not own a car.");
	    if(OwnedVeh(getcarid) == PlayerInfo[playerid][pPcarkey]) return SCM(playerid,COLOR_WHITE,"{FFB870}You already have car spawned.");
	    if(personalcar[playerid] != 0)
		{
			if(CarInfo[OwnedVeh(personalcar[playerid])][cNeon] != 0)
			{
			    DestroyObject(Neon1[personalcar[playerid]]);
			    DestroyObject(Neon2[personalcar[playerid]]);
			    Neon1[personalcar[playerid]] = 0;
			    Neon2[personalcar[playerid]] = 0;
			}
		    vUpdate(OwnedVeh(personalcar[playerid]), cKMx);
			DestroyVehicle(personalcar[playerid]);
			OwnedVeh(personalcar[playerid]) = 0;
			personalcar[playerid] = 0;
		}

 

Nu trebuie neaparat sa fie direct la onplayerdisconnect, poate fi intr-o functie gen "despawnaremasini" si sa fie apelata la onplayerdisconnect.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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