SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 14/07/2012, 04:50 AM   #11
Avi57
Gangsta
 
Avi57's Avatar
 
Join Date: Mar 2012
Location: Punjab, India
Posts: 707
Reputation: 15
Default Re: Little Help Needed !

Guys i have this code of OnPlayerRequestClass :
Code:
public OnPlayerRequestClass(playerid, classid)
{
    PlayerPlaySound(playerid,1097,1955.8129,-2181.6062,13.5865);
	SetPlayerPos(playerid,2480.3538,1870.8656,24.3753);
	SetPlayerCameraPos(playerid,2473.7202,1870.9253,25.7971);
	SetPlayerCameraLookAt(playerid,2480.3538,1870.8656,24.3753);
	SetPlayerFacingAngle(playerid,86.9258);
	switch(classid)
	{
	    case 0..6:
		{
	        GameTextForPlayer(playerid,"~g~~h~Trucker",2500,3);
	        gTeam[playerid] = TEAM_TRUCKERS;
		}
		case 7:
		{
		    GameTextForPlayer(playerid,"~r~Assistance",2500,3);
	        gTeam[playerid] = TEAM_ASSISTANCE;
		}
		case 8..14:
		{
		    GameTextForPlayer(playerid,"~b~Police",2500,3);
	        gTeam[playerid] = TEAM_POLICE;
		}
		case 15..19:
		{
		    GameTextForPlayer(playerid,"~g~~h~Taxi driver",2500,3);
	        gTeam[playerid] = TEAM_DRIVER;
		}
		case 20..23:
		{
		    GameTextForPlayer(playerid,"~p~~h~Others",2500,3);
		    gTeam[playerid]= TEAM_RAPIST;
  		}
	}
	return 1;
}
and For OnPlayerRequestSpawn :
Code:
public OnPlayerRequestSpawn(playerid)
{

    if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 284 || GetPlayerSkin(playerid) == 286 || GetPlayerSkin(playerid) == 288)
	{
		if(GetPlayerScore(playerid) < 50)
		{
			GameTextForPlayer(playerid,"~r~~h~100~b~score needed!",3000,3);
			SendClientMessage(playerid,red,"╗ You need at least "lgrey"100"lred" score to be a cop!");
		}
		return 0;
	}
	return 1;
}
Can anyone Just add two things ?
1. Add a score req. system for my Assistance Class : 20 Scores
2. Add a score requirement system for my Taxi Class : 50 Scores !

Thanks
__________________

Servers

ú0.10 Per Slot - Use SAMP30OFF to Get 30% Off
Free MySQL Database + Webhosting + Subdomain
Servers Situated at US - With Linux CentOS

Fractal Servers - Order Now
Avi57 is offline   Reply With Quote
Old 14/07/2012, 08:07 AM   #12
clarencecuzz
Gangsta
 
Join Date: Jul 2010
Location: Australia
Posts: 940
Reputation: 89
Default Re: Little Help Needed !

pawn Code:
public OnPlayerRequestSpawn(playerid)
{
    if(GetPlayerScore(playerid) < 50 && gTeam[playerid] == TEAM_DRIVER)
    {
        GameTextForPlayer(playerid,"~r~~h~50~b~score needed!",3000,3);
        SendClientMessage(playerid,red,"╗ You need at least "lgrey"50"lred" score to be a taxi driver!");
        return 0;
    }
    else if(GetPlayerScore(playerid) < 20 && gTeam[playerid] == TEAM_ASSISTANCE)
    {
        GameTextForPlayer(playerid, "~r~~h~20~b~score needed!", 3000, 3);
        SendClientMessage(playerid, red, "╗ You need at least "lgrey"20"lred" score to be assitance!");
        return 0;
    }
    return 1;
}
clarencecuzz is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 07:23 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.