Jump to content
  • 0

Ajutor...


TFreeman

Question

Am facut un system cu "Register Plates".Scriu /changeplate si ii dau /respawncar si imi apare numarul,dar cand parchez(/park) masina nu se salveaza numarul...trebuie sa adaog ceva la /park dar nu stiu ce.Va rog sa ma ajutati.

CMD:changeplate(playerid,params[])
{
	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{
		new plate[10], string[128], splate[22], vehid;
		vehid = GetPlayerVehicleID(playerid);
		if (sscanf(params, "s[10]", plate)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /changeplate [plate]");
		if (strlen(plate) > 10 || strlen(plate) < 1) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /changeplate [plate] (length 0-10)");
		format(string,128,"The plate was set to '%s' succesfully. Your car will respawn now!",plate);
                format(splate,22,"%s",plate);
		SetVehicleNumberPlate(vehid, plate);
		SetTimerEx("Respawn",1000,false,"i",playerid);
		PutPlayerInVehicle(playerid, GetPlayerVehicleID(playerid), 0);
		SendClientMessage(playerid,COLOR_WHITE,string);
	}
	else
	{
	    SendClientMessage(playerid,COLOR_WHITE,"You must be the driver or be in a vehicle!");
	}
	return 1;
}
CMD:park(playerid, params[])
{
  if(IsPlayerInVehicle(playerid, PlayerVehicleInfo[playerid][d][pvId]))
		{
			new Float:x, Float:y, Float:z, Float:angle, Float:health;
			GetVehicleHealth(PlayerVehicleInfo[playerid][d][pvId], health);
            if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessageEx(playerid, COLOR_GREY, "You must be in the driver seat.");
			if(health < 800) return SendClientMessageEx(playerid, COLOR_GREY, " Your vehicle is too damaged to park it.");
			if(PlayerInfo[playerid][pLockCar] == GetPlayerVehicleID(playerid)) PlayerInfo[playerid][pLockCar] = INVALID_VEHICLE_ID;
			GetVehiclePos(PlayerVehicleInfo[playerid][d][pvId], x, y, z);
                        GetVehicleZAngle(PlayerVehicleInfo[playerid][d][pvId], angle);
			SurfingCheck(GetPlayerVehicleID(playerid));
			UpdatePlayerVehicleParkPosition(playerid, d, x, y, z, angle, health);
			PutPlayerInVehicle(playerid, PlayerVehicleInfo[playerid][d][pvId], 0);
			SetPlayerArmedWeapon(playerid, 0);

            new string[30 + (MAX_PLAYER_NAME * 2)];
			format(string, sizeof(string), "* %s has parked their vehicle.", GetPlayerNameEx(playerid));
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			return 1;
		}
	}
	SendClientMessageEx(playerid, COLOR_GREY, "You need to be inside a vehicle that you own.");
	return 1;
}

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

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.