SA-MP Forums Archive
[Help] Randomise skin for males and females - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Help] Randomise skin for males and females (/showthread.php?tid=617835)



[Help] Randomise skin for males and females - StrikerZ - 27.09.2016

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]


Re: [Help] Randomise skin for males and females - Alpha000 - 27.09.2016

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


Re: [Help] Randomise skin for males and females - StrikerZ - 27.09.2016


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


Re: [Help] Randomise skin for males and females - Alpha000 - 27.09.2016

Yes..


Re: [Help] Randomise skin for males and females - StrikerZ - 27.09.2016

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.


Re: [Help] Randomise skin for males and females - Alpha000 - 27.09.2016

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

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


Re: [Help] Randomise skin for males and females - Alpha000 - 27.09.2016

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


Re: [Help] Randomise skin for males and females - StrikerZ - 27.09.2016

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


Re: [Help] Randomise skin for males and females - Alpha000 - 27.09.2016

These may help you

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

https://sampwiki.blast.hk/wiki/SetVehicleParamsEx


Re: [Help] Randomise skin for males and females - StrikerZ - 27.09.2016

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);
	            }

            }
        }
	}