31.03.2015, 20:20
why players have crashs with class system when is player killed sometimes he is crashed because problem is class system?? help what is problem
Code:
#define DIALOG_CLASS 0
Code:
public OnPlayerSpawn(playerid) { ShowPlayerDialog(playerid,DIALOG_CLASS,DIALOG_STYLE_LIST,"Class selection:","\n(100 score required)\n(300 score required)\n(500 score required)\n(1000 score required)","Choose",""); return 1; }
Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_CLASS) { if(!response) return ShowPlayerDialog(playerid,DIALOG_CLASS,DIALOG_STYLE_LIST,"Class selection:","\n(100 score required)\n(300 score required)\n(500 score required)\n(1000 score required)","Choose",""); if(response) { switch(listitem) { case 0: { GivePlayerWeapon(playerid,24,100); GivePlayerWeapon(playerid,16,1); GivePlayerWeapon(playerid,27,100); GivePlayerWeapon(playerid,31,80); } case 1: { if(GetPlayerScore(playerid) < 100) return SendClientMessage(playerid,0xFF0000,"You must have at least 100 score to play in this class!"),ShowPlayerDialog(playerid,DIALOG_CLASS,DIALOG_STYLE_LIST,"Class selection:","\n(100 score required)\n(300 score required)\n(500 score required)\n(1000 score required)","Choose",""); GivePlayerWeapon(playerid,34,50); GivePlayerWeapon(playerid,4,1); GivePlayerWeapon(playerid,23,100); GivePlayerWeapon(playerid,46,1); } case 2: { if(GetPlayerScore(playerid) < 300) return SendClientMessage(playerid,0xFF0000,"You must have at least 300 score to play in this class!"),ShowPlayerDialog(playerid,DIALOG_CLASS,DIALOG_STYLE_LIST,"Class selection:","\n(100 score required)\n(300 score required)\n(500 score required)\n(1000 score required)","Choose",""); GivePlayerWeapon(playerid,24,100); GivePlayerWeapon(playerid,25,60); GivePlayerWeapon(playerid,32,150); GivePlayerWeapon(playerid,16,1); } case 3: { if(GetPlayerScore(playerid) < 500) return SendClientMessage(playerid,0xFF0000,"You must have at least 300 score to play in this class!"),ShowPlayerDialog(playerid,DIALOG_CLASS,DIALOG_STYLE_LIST,"Class selection:","\n(100 score required)\n(300 score required)\n(500 score required)\n(1000 score required)","Choose",""); GivePlayerWeapon(playerid,37,300); GivePlayerWeapon(playerid,18,5); GivePlayerWeapon(playerid,24,20); GivePlayerWeapon(playerid,4,1); GivePlayerWeapon(playerid,25,100); } case 4: { if(GetPlayerScore(playerid) < 1000) return SendClientMessage(playerid,0xFF0000,"You must have at least 1000 score to play in this class!"),ShowPlayerDialog(playerid,DIALOG_CLASS,DIALOG_STYLE_LIST,"Class selection:","\n(100 score required)\n\n(500 score required)\n(1000 score required)","Choose",""); GivePlayerWeapon(playerid,26,150); GivePlayerWeapon(playerid,24,100); GivePlayerWeapon(playerid,16,2); GivePlayerWeapon(playerid,31,150); } } } } return 0; }