Jump to content
  • 0

Problema Masina Personala..


ToX1c

Question

Salut am si eu o problema la comanda /parkmycar , cand dau /parkmycar sting serverul si il pornesc din nou masina nu apare unde am dat /parkmycar

if (strcmp("/parkmycar", cmdtext, true, 10) == 0)
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must be in your car for this action");
        if(GetCreatorID(vehicleid)!=0)
        {
            if (strmatch(VehicleSystem[GetCreatorID(vehicleid)][owner],Spielername(playerid)))
            {
                new Float:VHealth;
                GetVehicleHealth(vehicleid, VHealth);
                if(VHealth >= 550)
                {
	                new Float:vx,Float:vy,Float:vz,Float:va;
	                GetVehiclePos(GetPlayerVehicleID(playerid),vx,vy,vz);
	                GetVehicleZAngle(GetPlayerVehicleID(playerid),va);
	                VehicleSystem[GetCreatorID(vehicleid)][xc]=vx;
	                VehicleSystem[GetCreatorID(vehicleid)][yc]=vy;
	                VehicleSystem[GetCreatorID(vehicleid)][zc]=vz;
	                VehicleSystem[GetCreatorID(vehicleid)][ac]=va;
	                SendClientMessage(playerid,COLOR_WHITE,"Masina a fost parcata aici!");
	                SendClientMessage(playerid,COLOR_YELLOW,"NOTE:Masina a fost Respawnata pentru a se salva locatia!");
                    SendClientMessage(playerid,COLOR_WHITE,"Ai platit 3.500$ pentru noul loc de parcare!");
					PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-3500;
					new Float:slx, Float:sly, Float:slz;
					GetPlayerPos(playerid, slx, sly, slz);
					SetPlayerPos(playerid, slx+1.3, sly, slz);
					new create = GetCreatorID(vehicleid);
					DestroyVehicle(vehicleid);
	        		new CAR = CreateVehicle(VehicleSystem[create][cmodel],VehicleSystem[create][xc],VehicleSystem[create][yc],VehicleSystem[create][zc],VehicleSystem[create][ac],VehicleSystem[create][Farbe1],VehicleSystem[create][Farbe2],-1);
	        		SetVehicleNumberPlate(CAR, VehicleSystem[GetCreatorID(vehicleid)][owner]);
	        		Tunen(CAR);
				}
				else
				{
				    SendClientMessage(playerid, COLOR_GREY, "* Vehicle health to low! ");
				}
            }
        }
        return 1;
    }

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

Am gasit o solutie de cate ori dau /parkmycar trebuie sa dau /savealldata

if(strcmp(cmd, "/savealldata", true) == 0)
	{
		if (PlayerInfo[playerid][pAdmin] >= 3)
		{
			SaveAccounts();
			OnPropUpdate();
			SaveTool();
			SendClientMessage(playerid, COLOR_YELLOW, "All player accounts saved successfully.");
		}
		else
		{
			SendClientMessage(playerid, COLOR_ORANGE, "DENIED: {FFFFFF}You are not authorized to use that command.");
		}
		return 1;
	}

Eu as vrea sa fac fara sa dau /savealldata de fiecare data cand dau parkmycar

Link to comment
Share on other sites

Mai am o problema cand dau /lockmycar la masina personala nu se incuie ..

if (strcmp("/lockmycar", cmdtext, true, 10) == 0)
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must be in your car for this action");
    	if(GetCreatorID(vehicleid)!=0)
     	{
			if (strmatch(VehicleSystem[GetCreatorID(vehicleid)][owner],Spielername(playerid)))
   			{
				if(Locked[vehicleid] == 0)
	            {
	                Locked[vehicleid] = 1;
	                VehicleSystem[vehicleid][Lock] = 1;
	                for(new i=0; i < MAX_PLAYERS; i++)
				    {
				        if(i == playerid) continue;
				        SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,1);
				    }
	                SendClientMessage(playerid, COLOR_GREY, "You have locked your car!");
	                GetPlayerName(playerid, sendername, sizeof(sendername));
	                format(string, sizeof(string), "* %s is locking his personal vehicle and puts the key in his pocket.", sendername);
					ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					GameTextForPlayer(playerid, "~w~Personal Vehicle ~r~Locked", 5000, 6);
					PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
				}
				else if(Locked[vehicleid] == 1)
				{
					SendClientMessage(playerid, COLOR_GREY, "Your car is already locked!");
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "This is not you're car");
			}
		}
		return 1;
	}
    if (strcmp("/unlockmycar", cmdtext, true, 10) == 0)
    {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must be in your car for this action");
    	if(GetCreatorID(vehicleid)!=0)
     	{
			if (strmatch(VehicleSystem[GetCreatorID(vehicleid)][owner],Spielername(playerid)))
   			{
				if(Locked[vehicleid] == 1)
	            {
	                Locked[vehicleid] = 0;
	                VehicleSystem[vehicleid][Lock] = 0;
	                for(new i=0; i < MAX_PLAYERS; i++)
				    {
				        if(i == playerid) continue;
				        SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,0);
				    }
	                SendClientMessage(playerid, COLOR_GREY, "You have Unlocked you're car!");
	                GetPlayerName(playerid, sendername, sizeof(sendername));
	                format(string, sizeof(string), "* %s looks in his pocket for his car key. He finds the key and unlocks his personal vehicle.", sendername);
					ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					GameTextForPlayer(playerid, "~w~Personal Vehicle ~g~UnLocked", 5000, 6);
					PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
				}
				else if(Locked[vehicleid] == 0)
				{
					SendClientMessage(playerid, COLOR_GREY, "You're car is already unlocked!");
				}
			}
		}
		return 1;
	}

Link to comment
Share on other sites

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	new str[80];
	format(str, sizeof(str), "~g~%s",vehName[GetVehicleModel(vehicleid)-400]);
    GameTextForPlayer(playerid, str, 300, 1);
	if (IsAPdCar(vehicleid) && !ispassenger)
	{

Doar asta e la onplayerentervehicle

Link to comment
Share on other sites

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.