SA-MP Forums Archive
How let select class if time passed - 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: How let select class if time passed (/showthread.php?tid=630811)



How let select class if time passed - henkas - 18.03.2017

How can i let select class if time is passed, for example >210 I can select, <210 i cant select. So if time passed i want make that, you can select class, bat just with one condition you press on it and you get message "Class will be selected on next round", so if i DIE or NEXT MAP started then i get that class. I hope you understand what i mean.

P.S is let you select if time is not passed 210.
Код:
	case DIALOG_CLASS_2:
	{
    if(teams[playerid] == TEAM_RED)
    {
    if(response)
    {
    if(times >= 210)
    {
    switch(listitem)
    {
	case 0: if(pInfo[playerid][pXP] >= 0) pInfo[playerid][pRedClass] = 0,pInfo[playerid][pHumanClass] = CIVILIAN,setClass(playerid); else { SendXPError(playerid,0); }
	case 1: if(pInfo[playerid][pXP] >= 1000) pInfo[playerid][pRedClass] = 0,pInfo[playerid][pHumanClass] = POLICEMAN,setClass(playerid); else { SendXPError(playerid,1000); }
	case 2: if(pInfo[playerid][pXP] >= 2000) pInfo[playerid][pRedClass] = 0,pInfo[playerid][pHumanClass] = MEDIC,setClass(playerid); else { SendXPError(playerid,2000); }
This is setClass stock

Код:
stock setClass(playerid)
{
	if(teams[playerid] == TEAM_RED)
	{
	    ResetPlayerWeapons(playerid);
		switch(pInfo[playerid][pRedClass])
		{
		    case CIVILIAN:
		    {
		        GivePlayerWeapon(playerid,23,50);
		        GivePlayerWeapon(playerid,25,70);
		        SetPlayerArmour(playerid,0);
		        switch(random(6))
		        {
		            case 0: SetPlayerSkin(playerid,5);
		            case 1: SetPlayerSkin(playerid,23);
		            case 2: SetPlayerSkin(playerid,56);
		            case 3: SetPlayerSkin(playerid,289);
		            case 4: SetPlayerSkin(playerid,299);
				}
			}

			case POLICEMAN:
			{
			    GivePlayerWeapon(playerid,24,72);
		        GivePlayerWeapon(playerid,25,80);
		        SetPlayerArmour(playerid,0);
		        SetPlayerSkin(playerid,281);
			}

			case MEDIC:
			{
   				GivePlayerWeapon(playerid,23,100);
		        GivePlayerWeapon(playerid,25,110);
		        SetPlayerArmour(playerid,10);
		        SetPlayerSkin(playerid,275);
			}
		}
	}
setClass i use in "OnPlayerSpawn"


Re: How let select class if time passed - henkas - 19.03.2017

Bump


Re: How let select class if time passed - henkas - 19.03.2017

bump


Re: How let select class if time passed - coool - 19.03.2017

There is
Quote:

if(times >= 210)

in the first one change 210 to your desired time. Is that what you want?


Re: How let select class if time passed - Pokemon64 - 19.03.2017

Quote:
Originally Posted by coool
Посмотреть сообщение
There is

in the first one change 210 to your desired time. Is that what you want?
Read, dude.


Re: How let select class if time passed - henkas - 19.03.2017

Quote:
Originally Posted by coool
Посмотреть сообщение
There is

in the first one change 210 to your desired time. Is that what you want?
No. I want make if time passed 210sec class will set only if i die or next round started.


Re: How let select class if time passed - henkas - 19.03.2017

Bump


Re: How let select class if time passed - henkas - 19.03.2017

Any ideas?


Re: How let select class if time passed - henkas - 24.03.2017

Bump


Re: How let select class if time passed - jasperschellekens - 25.03.2017

Create a timer?