How can i edit gui selection (TIME)
#1

So i have system if i didn't reach my time like example 210 second, map start with 250 second i can use gui table bat if time passed 210 second i cant use it, bat i can press on that gui selection and allow me chose what i want bat important part that this gui give me nothing just set my selection for future like i get that slection if i die or new round started then i get it. Like example if passed 210second
I open gui table and i choose "Test - M4, GLOCK - 1500xp" i press on it and get nothing bat if i dead or new round started then i automatically get it. So conclusion if time passed over 210 i press on gui selection i get message "Class will select if you dead or new round will started". I have made something like this already bat its not over.
look like this.
Код:
    case DIALOG_CLASS_5:
    {
    if(teams[playerid] == TEAM_ZOMBIE)
    {
    if(response)
    {
    if(times >= 210) // so if time passed 210 second i can use this anymore. I need make this like i said.
    {
    switch(listitem)
    {
    case 0: if(pInfo[playerid][pXP] >= 15000) pInfo[playerid][pZombieClass] = 0,pInfo[playerid][pZombieClass] = ADVANCEDBOOMER,setClass(playerid); else { SendXPError(playerid,15000); }
    case 1: if(pInfo[playerid][pXP] >= 50000) pInfo[playerid][pZombieClass] = 0,pInfo[playerid][pZombieClass] = FREEZERZOMBIE,setClass(playerid); else { SendXPError(playerid,50000); }
    }
P.S i have and this script part. I think its important to.
Код:
stock setClass(playerid)
{
	if(teams[playerid] == TEAM_ZOMBIE)
	{
	    ResetPlayerWeapons(playerid);
		GivePlayerWeapon(playerid,9,1);
		SetPlayerArmour(playerid,0);
	    switch(pInfo[playerid][pZombieClass])
	    {
	        case ADVANCEDBOOMER: SetPlayerSkin(playerid,130), SetPlayerHealth(playerid,50);
	        case FREEZERZOMBIE: SetPlayerSkin(playerid,137), SetPlayerHealth(playerid,45);
		}
	}
	return 1;
}
I use it on OnPlayerSpawn

I hope guys you will understand it. Sorry for my poorly worded sentences.
Reply
#2

Bump
Reply
#3

You can do it like this :
PHP код:
new choice[MAX_PLAYERS];//global variable, place this line at top of script under includes
if(response)
{
        switch(
listitem)
        {
            case 
0: {
                if(
pInfo[playerid][pXP] >= 15000
                {
                    if(
times >= 210)selection[playerid] = 0;//if time is over 210 then it will NOT execute BELOW line
                    
else pInfo[playerid][pZombieClass] = 0,pInfo[playerid][pZombieClass] = ADVANCEDBOOMER,setClass(playerid);
                }
                else 
SendXPError(playerid,15000); 
            }
            case 
1: {
                if(
pInfo[playerid][pXP] >= 50000)
                {
                    if(
times >= 210)selection[playerid] = 1;//if time is over 210 then it will NOT execute BELOW line
                    
else pInfo[playerid][pZombieClass] = 0,pInfo[playerid][pZombieClass] = FREEZERZOMBIE,setClass(playerid); 
                }
                else 
SendXPError(playerid,50000);
            }
        } 
Now place the below code in when the new round starts or player spawn after his death :
PHP код:
//on new round or player spawning after death
if(selection[playerid] != -1)
{
    switch(
selection[playerid])
    {
        case 
0pInfo[playerid][pZombieClass] = 0,pInfo[playerid][pZombieClass] = ADVANCEDBOOMER,setClass(playerid);
        case 
1pInfo[playerid][pZombieClass] = 0,pInfo[playerid][pZombieClass] = FREEZERZOMBIE,setClass(playerid); 
    }
    
selection[playerid] = -1;//reset player selection

Oh and put this line in OnPlayerConnect:
PHP код:
selection[playerid] = -1;//clearing selection of person who was last logged in with this id 
Reply
#4

Quote:
Originally Posted by BroZeus
Посмотреть сообщение
You can do it like this :
PHP код:
new choice[MAX_PLAYERS];//global variable, place this line at top of script under includes
if(response)
{
        switch(
listitem)
        {
            case 
0: {
                if(
pInfo[playerid][pXP] >= 15000
                {
                    if(
times >= 210)selection[playerid] = 0;//if time is over 210 then it will NOT execute BELOW line
                    
else pInfo[playerid][pZombieClass] = 0,pInfo[playerid][pZombieClass] = ADVANCEDBOOMER,setClass(playerid);
                }
                else 
SendXPError(playerid,15000); 
            }
            case 
1: {
                if(
pInfo[playerid][pXP] >= 50000)
                {
                    if(
times >= 210)selection[playerid] = 1;//if time is over 210 then it will NOT execute BELOW line
                    
else pInfo[playerid][pZombieClass] = 0,pInfo[playerid][pZombieClass] = FREEZERZOMBIE,setClass(playerid); 
                }
                else 
SendXPError(playerid,50000);
            }
        } 
Now place the below code in when the new round starts or player spawn after his death :
PHP код:
//on new round or player spawning after death
if(selection[playerid] != -1)
{
    switch(
selection[playerid])
    {
        case 
0pInfo[playerid][pZombieClass] = 0,pInfo[playerid][pZombieClass] = ADVANCEDBOOMER,setClass(playerid);
        case 
1pInfo[playerid][pZombieClass] = 0,pInfo[playerid][pZombieClass] = FREEZERZOMBIE,setClass(playerid); 
    }
    
selection[playerid] = -1;//reset player selection

Oh and put this line in OnPlayerConnect:
PHP код:
selection[playerid] = -1;//clearing selection of person who was last logged in with this id 
Now selection dont even response i can click how many times i want its doesn't functional at all.
Reply
#5

Bump
Reply
#6

Bump
Reply
#7

Up up up
Reply
#8

Bump
Reply
#9

Bump
Reply
#10

Up up up
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)