[Help] Randomise skin for males and females
#1

Hey there. So i got a rp script, the player spawns with 299 id skin with both female and male gender. I want it like this, if player is male then a random male skin will be given to him and if he/she selects female then a random female skin would be given to her. Any idea on how to do this?
Default variables in script on spawn:
PlayerInfo[playerid][pModel] = 299;

Male and female info:
PlayerInfo[playerid][pSex] == 2[female]
PlayerInfo[playerid][pSex] == 1[male]
Reply
#2

If(PlayerInfo[playerid][pSex] == 1)
{
PlayerInfo[playerid][pModel] = 299
}
else
{
PlayerInfo[playerid][pModel] =(any female skin id u want)
}
Reply
#3


Can i insert that IF statement into that default variable pmodel line?
Reply
#4

Yes..
Reply
#5

Do you know how to make something like this. A player hits anything inside a vehicle and then the screen would shake i.e. Drunklevel would be set at that time when he hits something with his car.
Reply
#6

Yea use this
https://sampwiki.blast.hk/wiki/OnVehicleDamageStatusUpdate

And related functions given in it...they might help u...btw that skin thing worked?
Reply
#7

Use this
https://sampwiki.blast.hk/wiki/GetVehicleHealth

If vehicle health is lower then 800 (full health is 1000) or something then set player drunk
Reply
#8

Yes skin worked and btw when i enter any car its engine turns on automatically i want it to get started by using /engine and not automatically when we enter it that is to set engine off from the script on entering the vehicle for first time
Reply
#9

These may help you

https://sampforum.blast.hk/showthread.php?tid=306311

https://sampwiki.blast.hk/wiki/SetVehicleParamsEx
Reply
#10

still cant figure out the engine thing
Код:
	if(strcmp(cmd, "/engine", true) == 0)
	{
	    if(!IsPlayerInAnyVehicle(playerid))
		{
			SendClientMessage(playerid,COLOR_GREY,"   You are not in a vehicle!");
			return 1;
		}
		if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { return 1; }
        new vehid = GetPlayerVehicleID(playerid);

        if(vehid != INVALID_VEHICLE_ID) {

            if(Gas[vehid] < 1) {
				return SendClientMessage(playerid,COLOR_GREY,"   That vehicle is out of fuel !");
			}
            if(IsVehicleTotaled[GetPlayerVehicleID(playerid)] == 1) return SendClientMessage(playerid,COLOR_GREY,"   This vehicle is totaled!");
            new engine,lights,alarm,doors,bonnet,boot,objective;
            GetVehicleParamsEx(vehid,engine,lights,alarm,doors,bonnet,boot,objective);

            if(engineOn[vehid] == 0)
			{
			    new cid = PlayerInfo[playerid][pCar][0], cid2 = PlayerInfo[playerid][pCar][1];
			    new veh = GetPlayerVehicleID(playerid);
				if(GetVehNeedHW(vehid, playerid))
				{
					return SendClientMessage(playerid, COLOR_GRAD2,"   You do not have the key for this vehicle! ( /(h)ot(w)ire )");
				}
				if(veh == CarInfo[cid][c_ID] || veh == CarInfo[cid2][c_ID])
				{
  				SetVehicleParamsEx(vehid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
  				engineOn[vehid] = 1;
            	playerDisabledEngine[vehid] = 0;

            	if(PlayerInfo[playerid][pMask])
				{
					ProxDetector(30.0, playerid, "* Stranger twists the key in the ignition, turning the engine on.", COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	            }
				else
				{
	           		format(string, sizeof(string), "%s twists the key in the ignition, turning the engine on.", PlayerRPName(playerid));
            		ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	            }
				}
				else
				{
                SendClientMessage(playerid,COLOR_GREY,"You don't own this vehicle !");
				}
			}
			else
			{
				SetVehicleParamsEx(vehid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
                engineOn[vehid] = 0;
                playerDisabledEngine[vehid] = 1;

                if(PlayerInfo[playerid][pMask]) {
                	ProxDetector(30.0, playerid, "* Stranger twists the key in the ignition, turning the engine off.", COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	            }
				else
				{
	            	format(string, sizeof(string), "* %s twists the key in the ignition, turning the engine off.", PlayerRPName(playerid));
	                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	            }

            }
        }
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)