18.09.2015, 23:49
i made this code if time >275 than player can change class..otherwise if time <275 set class for next spawn..but its not working plz see what i forgot in this code
PHP код:
case DIALOG_CLASS_1:
{
if(response)
{
if(time >= 275)
{
switch(listitem)
{
case 0: if(pInfo[playerid][pXP] >= 0) pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 0,pInfo[playerid][pHumanClass] = CIVILIAN,setClass(playerid); else { SendXPError(playerid,0); }
case 1: if(pInfo[playerid][pXP] >= 500) pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 0,pInfo[playerid][pHumanClass] = POLICEMAN,setClass(playerid); else { SendXPError(playerid,500); }
case 2: if(pInfo[playerid][pXP] >= 1000) pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 0,pInfo[playerid][pHumanClass] = MEDIC,setClass(playerid); else { SendXPError(playerid,1000); }
case 3: if(pInfo[playerid][pXP] >= 1500) pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 0,pInfo[playerid][pHumanClass] = SCOUT,setClass(playerid); else { SendXPError(playerid,1500); }
case 4: if(pInfo[playerid][pXP] >= 5000) pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 0,pInfo[playerid][pHumanClass] = HEAVYMEDIC,setClass(playerid); else { SendXPError(playerid,5000); }
case 5: if(pInfo[playerid][pXP] >= 6000) pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 0,pInfo[playerid][pHumanClass] = FARMER,setClass(playerid); else { SendXPError(playerid,6000); }
case 6: if(pInfo[playerid][pXP] >= 6500) pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 0,pInfo[playerid][pHumanClass] = SOLDIER,setClass(playerid); else { SendXPError(playerid,6500); }
case 7: if(pInfo[playerid][pXP] >= 7500) pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 0,pInfo[playerid][pHumanClass] = ENGINEER,setClass(playerid); else { SendXPError(playerid,7500); }
case 8: if(pInfo[playerid][pXP] >= 15000) pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 0,pInfo[playerid][pHumanClass] = SWAT,setClass(playerid); else { SendXPError(playerid,15000); }
case 9: if(pInfo[playerid][pXP] >= 20000) pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 0,pInfo[playerid][pHumanClass] = HEAVYSHOTGUN,setClass(playerid); else { SendXPError(playerid,20000); }
case 10: if(pInfo[playerid][pXP] >= 30000) pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 0,pInfo[playerid][pHumanClass] = ADVANCEDENGINEER,setClass(playerid); else { SendXPError(playerid,30000); }
}
}
else if (pInfo[playerid][pXP] >= 0) pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 0,pInfo[playerid][pHumanClass] = CIVILIAN;
else if (pInfo[playerid][pXP] >= 500) pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 0,pInfo[playerid][pHumanClass] = POLICEMAN;
else if (pInfo[playerid][pXP] >= 1000) pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 0,pInfo[playerid][pHumanClass] = MEDIC;
else if (pInfo[playerid][pXP] >= 1500) pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 0,pInfo[playerid][pHumanClass] = SCOUT;
else if (pInfo[playerid][pXP] >= 5000) pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 0,pInfo[playerid][pHumanClass] = HEAVYMEDIC;
else if (pInfo[playerid][pXP] >= 6000) pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 0,pInfo[playerid][pHumanClass] = FARMER;
else if (pInfo[playerid][pXP] >= 6500) pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 0,pInfo[playerid][pHumanClass] = SOLDIER;
else if (pInfo[playerid][pXP] >= 7500) pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 0,pInfo[playerid][pHumanClass] = ENGINEER;
else if (pInfo[playerid][pXP] >= 15000) pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 0,pInfo[playerid][pHumanClass] = SWAT;
else if (pInfo[playerid][pXP] >= 20000) pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 0,pInfo[playerid][pHumanClass] = HEAVYSHOTGUN;
else if (pInfo[playerid][pXP] >= 30000) pInfo[playerid][pHumanClass] = 0,pInfo[playerid][SkinChanges] -= 0,pInfo[playerid][pHumanClass] = ADVANCEDENGINEER;
else return SendClientMessage(playerid,-1,""chat""COL_RED" Class Set Will Change on Next Round");
}
}