Jump to content

Question

Posted

Am o problema , acesta e dialogu de la vpark [pawn] if(dialogid==DIALOGVPOSITION)

{

    if(response)

    {

        switch(listitem)

        {

            case 0:

            {

        new Float:x,Float:y,Float:z,Float:a;

if(!IsPlayerInAnyVehicle(playerid))

{

GetPlayerPos(playerid,x,y,z);

GetPlayerFacingAngle(playerid,a);

CarInfo[PlayerInfo[playerid][pPcarkey]][cLocationx] = x;

CarInfo[PlayerInfo[playerid][pPcarkey]][cLocationy] = y;

CarInfo[PlayerInfo[playerid][pPcarkey]][cLocationz] = z;

CarInfo[PlayerInfo[playerid][pPcarkey]][cAngle] = a;

}

else

{

GetVehiclePos(vehid,x,y,z);

GetVehicleZAngle(vehid,a);

CarInfo[PlayerInfo[playerid][pPcarkey]][cLocationx] = x;

CarInfo[PlayerInfo[playerid][pPcarkey]][cLocationy] = y;

CarInfo[PlayerInfo[playerid][pPcarkey]][cLocationz] = z;

CarInfo[PlayerInfo[playerid][pPcarkey]][cAngle] = a;

}

format(string, sizeof(string), "  [%s]: {3D9AD4}New position saved.",CarInfo[PlayerInfo[playerid][pPcarkey]][cDescription]);

SendClientMessage(playerid, COLOR_YELLOW, string);

OnCarUpdate(); SavePlayerData(playerid);

            }

            case 1:

            {

                new Float:x,Float:y,Float:z,Float:a;

if(!IsPlayerInAnyVehicle(playerid))

{

GetPlayerPos(playerid,x,y,z);

GetPlayerFacingAngle(playerid,a);

CarInfo[PlayerInfo[playerid][pPcarkey2]][cLocationx] = x;

CarInfo[PlayerInfo[playerid][pPcarkey2]][cLocationy] = y;

CarInfo[PlayerInfo[playerid][pPcarkey2]][cLocationz] = z;

CarInfo[PlayerInfo[playerid][pPcarkey2]][cAngle] = a;

}

else

{

GetVehiclePos(vehid,x,y,z);

GetVehicleZAngle(vehid,a);

CarInfo[PlayerInfo[playerid][pPcarkey2]][cLocationx] = x;

CarInfo[PlayerInfo[playerid][pPcarkey2]][cLocationy] = y;

CarInfo[PlayerInfo[playerid][pPcarkey2]][cLocationz] = z;

CarInfo[PlayerInfo[playerid][pPcarkey2]][cAngle] = a;

  }

                    format(string, sizeof(string), "  [%s]: {3D9AD4}New position saved.",CarInfo[PlayerInfo[playerid][pPcarkey2]][cDescription]);

SendClientMessage(playerid, COLOR_YELLOW, string);

OnCarUpdate(); SavePlayerData(playerid);

            }

        }

    }

}

[/pawn]

Dar trebuie sa se dea rr la server ca sa se respawneze in acel loc , cum fac ca dupa ce dai /v park masina personala sa se spawneze automat acolo

Ceva de genu DestroyVehicle Dupa createvehicle (am incercat dar nu am reusit , multumesc anticipat de ajutor)

7 answers to this question

Recommended Posts

Posted

faci asa

new tvid ; 

tvid = GetPlayerVehicleID( playerid ); 

DestroyVehicle( GetPlayerVehicleID( playerid ) ) , CreateVehicle( tvid , CarInfo[PlayerInfo[playerid][pPcarkey2][cLocationx], CarInfo[PlayerInfo[playerid][pPcarkey2]][cLocationy] , CarInfo[PlayerInfo[playerid][pPcarkey2]][cLocationz] , 0  , 0 , 500 ) ; 

Asa ar veni ... ! doar trebuie sa sti unde sa pui =))

I'm back bitches.

Posted

Aceiasi problema am si eu ...

/v park

[pawn] else if(strcmp(x_nr,"park",true) == 0)

{

if(PlayerInfo[playerid][pCar] == 9999)

{

SendClientMessage(playerid, COLOR_GREY, "Tu nu detii un Vehicul.");

return 1;

}

if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)

{

new carid = GetPlayerVehicleID(playerid);

if(carid == PlayerInfo[playerid][pCar])

{

new Float:x,Float:y,Float:z;

new Float:a;

GetPlayerName(playerid, playername, sizeof(playername));

GetVehiclePos(carid, x, y, z);

GetVehicleZAngle(carid, a);

CarInfo[carid][cLocationx] = x;

CarInfo[carid][cLocationy] = y;

CarInfo[carid][cLocationz] = z;

CarInfo[carid][cAngle] = a;

format(string, sizeof(string), "{FFFFFF}Masina ta a fost salvata {FF3333}%f.01, %f.01, %f.01, Tine minte ! La RR va fi spawnata aici!",x,y,z);

SendClientMessage(playerid, TEAM_GROVE_COLOR, string);

SaveCar(carid);

}

else

{

SendClientMessage(playerid, COLOR_GREY, "Tu nu esti in masina ta.");

return 1;

}

}

else

{

SendClientMessage(playerid, COLOR_GREY, "Tu nu esti in masina ta.");

return 1;

}

return 1;

}[/pawn]

/v color

[pawn] else if(strcmp(x_nr,"color",true) == 0)

{

if(PlayerInfo[playerid][pCar] == 9999)

{

SendClientMessage(playerid, COLOR_GREY,"* Nu detineti un vehicul personal pentru al vopsi.");

return 1;

}

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_WHITE, "Folosire: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)");

return 1;

}

new color1;

color1 = strval(tmp);

if(color1 < 0 && color1 > 126)

{

SendClientMessage(playerid, COLOR_GREY, "  Ati gresit id`ul culori!");

return 1;

}

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_WHITE, "Folosire: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)");

return 1;

}

new color2;

color2 = strval(tmp);

if(color2 < 0 && color2 > 126)

{

SendClientMessage(playerid, COLOR_GREY, "  Ati gresit id`ul culori!");

return 1;

}

if(GetPlayerMoney(playerid) < 50000)

{

SendClientMessage(playerid, COLOR_GREY, "  Nu ai suficienti bani!");

return 1;

}

if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)

{

new vehid = GetPlayerVehicleID(playerid);

if(CarInfo[vehid][cID] == PlayerInfo[playerid][pCar])

{

CarInfo[vehid][cColorOne] = color1;

CarInfo[vehid][cColorTwo] = color2;

ChangeVehicleColor(vehid, color1, color2);

GivePlayerMoney(playerid, -50000);

SendClientMessage(playerid, COLOR_WHITE, "{FF3333}Ti-ai modificat culoarea!");

SaveCar(vehid);

}

else

{

SendClientMessage(playerid, COLOR_GREY, "Tu nu esti in masina ta.");

return 1;

}

}

else

{

SendClientMessage(playerid, COLOR_GREY, "Tu nu esti in masina ta.");

return 1;

}

return 1;

}[/pawn]

Posted

Asa dar vezi ca trebuie sa mai aranjezi ...

	if(dialogid==DIALOGVPOSITION)
	{
	    if(response)
	    {
	        switch(listitem)
	        {
	            case 0:
	            {
	         	new Float:x,Float:y,Float:z,Float:a;
					if(!IsPlayerInAnyVehicle(playerid))
					{
                                               SendClientMessage( playerid , -1 , "Nu esti intr-o masina !");
					}
					else
					{
						GetVehiclePos(vehid,x,y,z);
						GetVehicleZAngle(vehid,a);
						CarInfo[PlayerInfo[playerid][pPcarkey]][cLocationx] = x;
						CarInfo[PlayerInfo[playerid][pPcarkey]][cLocationy] = y;
						CarInfo[PlayerInfo[playerid][pPcarkey]][cLocationz] = z;
						CarInfo[PlayerInfo[playerid][pPcarkey]][cAngle] = a;
					}
					format(string, sizeof(string), "  [%s]: {3D9AD4}New position saved.",CarInfo[PlayerInfo[playerid][pPcarkey]][cDescription]);
					SendClientMessage(playerid, COLOR_YELLOW, string);
					OnCarUpdate(); SavePlayerData(playerid);
new tvid ; 

tvid = GetPlayerVehicleID( playerid ); 

DestroyVehicle( GetPlayerVehicleID( playerid ) ) , CreateVehicle( tvid , CarInfo[PlayerInfo[playerid][pPcarkey2][cLocationx], CarInfo[PlayerInfo[playerid][pPcarkey2]][cLocationy] , CarInfo[PlayerInfo[playerid][pPcarkey2]][cLocationz] , 0  , 0 , 500 ) ; 

	            }
	            case 1:
	            {
	                new Float:x,Float:y,Float:z,Float:a;
					if(!IsPlayerInAnyVehicle(playerid))
					{
                                             SendClientMessage( playerid , -1 , "Nu esti intr-o masina !");
					}
					else
					{
						GetVehiclePos(vehid,x,y,z);
						GetVehicleZAngle(vehid,a);
						CarInfo[PlayerInfo[playerid][pPcarkey2]][cLocationx] = x;
						CarInfo[PlayerInfo[playerid][pPcarkey2]][cLocationy] = y;
						CarInfo[PlayerInfo[playerid][pPcarkey2]][cLocationz] = z;
						CarInfo[PlayerInfo[playerid][pPcarkey2]][cAngle] = a;
  			}
                    format(string, sizeof(string), "  [%s]: {3D9AD4}New position saved.",CarInfo[PlayerInfo[playerid][pPcarkey2]][cDescription]);
					SendClientMessage(playerid, COLOR_YELLOW, string);
					OnCarUpdate(); SavePlayerData(playerid);
                         new tvid ; 

tvid = GetPlayerVehicleID( playerid ); 

DestroyVehicle( GetPlayerVehicleID( playerid ) ) , CreateVehicle( tvid , CarInfo[PlayerInfo[playerid][pPcarkey2][cLocationx], CarInfo[PlayerInfo[playerid][pPcarkey2]][cLocationy] , CarInfo[PlayerInfo[playerid][pPcarkey2]][cLocationz] , 0  , 0 , 500 ) ; 
	            }
	        }
	    }
	}


I'm back bitches.

Posted

Imi da eroarea asta

C:\Users\Elev\Desktop\GTA.THEG.RO\gamemodes\Godfather.pwn(17130) : error 001: expected token: "]", but found "["
C:\Users\Elev\Desktop\GTA.THEG.RO\gamemodes\Godfather.pwn(17156) : error 001: expected token: "]", but found "["
Si liniile 17130 si 17156 sunt amandoua la fel
DestroyVehicle( GetPlayerVehicleID( playerid ) ) , CreateVehicle( tvid , CarInfo[PlayerInfo[playerid][pPcarkey2][cLocationx], CarInfo[PlayerInfo[playerid][pPcarkey2]][cLocationy] , CarInfo[PlayerInfo[playerid][pPcarkey2]][cLocationz] , 0  , 0 , 500 ) ;

De la ce o fi oare?

Posted

DestroyVehicle( GetPlayerVehicleID( playerid ) ), CreateVehicle( tvid , CarInfo[PlayerInfo[playerid][pPcarkey2][cLocationx], CarInfo[PlayerInfo[playerid][pPcarkey2][cLocationy] , CarInfo[PlayerInfo[playerid][pPcarkey2][cLocationz] , 0  , 0 , 500 ) ;

sau

DestroyVehicle( GetPlayerVehicleID( playerid ), CreateVehicle( tvid , CarInfo[PlayerInfo[playerid][pPcarkey2][cLocationx], CarInfo[PlayerInfo[playerid][pPcarkey2][cLocationy] , CarInfo[PlayerInfo[playerid][pPcarkey2][cLocationz] , 0  , 0 , 500 ) ;

idiots.png
Guest
This topic is now closed to further replies.
×
×
  • 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.