HELP Command for Change Class HELP
#1

Hello I have these classes

Код HTML:
OnPlayerSpawn 
{ 
switch(gPlayerClass[playerid])
    {
        case ASSAULT:
        {
            TogglePlayerControllable(playerid, 1);
	        ResetPlayerWeapons(playerid);
	        GivePlayerWeapon(playerid, 31, 200);//m4
	        GivePlayerWeapon(playerid, 29, 100);//mp5
	        GivePlayerWeapon(playerid, 27, 100);//  combat
	        GivePlayerWeapon(playerid, 24, 70);//deagle
        }
        case SNIPER:
        {
            TogglePlayerControllable(playerid, 1);
	        ResetPlayerWeapons(playerid);
	        GivePlayerWeapon(playerid, 23, 200);//silent pistol
	        GivePlayerWeapon(playerid, 34, 250);//sniper
	        GivePlayerWeapon(playerid, 29, 250);//mp5
	        GivePlayerWeapon(playerid, 4, 1);//knife
	        RemovePlayerMapIcon(playerid, 0);
         	SetPlayerColor(playerid,COLOR_TRANSPARENT_MAP);
		}
	    case MEDIC:
		{
          	if(GetPlayerScore(playerid) >= 500){   // or if you have one variable  for scores PlayerInfo[playerid][score] >= 500 ...
          	TogglePlayerControllable(playerid, 1);
	  		ResetPlayerWeapons(playerid);
	 	    GivePlayerWeapon(playerid, 33, 200);
	  		GivePlayerWeapon(playerid, 22, 200);
	  		GivePlayerWeapon(playerid, 25, 200);
	  		GivePlayerWeapon(playerid, 11, 2);
          	}
          	else return SendClientMessage(playerid,-1,"You are not have 500+ scores for select this class");
			}
    }
return
But how to make a command which brings you to this selection?
NOTE THIS is not Team select! This is a class selection!!
Help mee
Reply
#2

Код:
#define DIALOG_CLASSSELECT 3221



CMD:changeclass(playerid,params[]){
	#pragma unused params
	ShowPlayerDialog(playerid,DIALOG_CLASSSELECT,DIALOG_STYLE_LIST,"Select Class","ASSAULT\nSNIPER\nMEDIC","Select","exit");
	return 1;
}


ondialogresponse...

if(dialogid == DIALOG_CLASSSELECT){

	switch(listitem){
		case 0:{
			 TogglePlayerControllable(playerid, 1);
	        ResetPlayerWeapons(playerid);
	        GivePlayerWeapon(playerid, 31, 200);//m4
	        GivePlayerWeapon(playerid, 29, 100);//mp5
	        GivePlayerWeapon(playerid, 27, 100);//  combat
	        GivePlayerWeapon(playerid, 24, 70);//deagle
		}
		case 1:{
		
			TogglePlayerControllable(playerid, 1);
	        ResetPlayerWeapons(playerid);
	        GivePlayerWeapon(playerid, 23, 200);//silent pistol
	        GivePlayerWeapon(playerid, 34, 250);//sniper
	        GivePlayerWeapon(playerid, 29, 250);//mp5
	        GivePlayerWeapon(playerid, 4, 1);//knife
	        RemovePlayerMapIcon(playerid, 0);
         	SetPlayerColor(playerid,COLOR_TRANSPARENT_MAP);
		
		}
		case 2:{
		
			if(GetPlayerScore(playerid) >= 500){ 
          	TogglePlayerControllable(playerid, 1);
	  		ResetPlayerWeapons(playerid);
	 	    GivePlayerWeapon(playerid, 33, 200);
	  		GivePlayerWeapon(playerid, 22, 200);
	  		GivePlayerWeapon(playerid, 25, 200);
	  		GivePlayerWeapon(playerid, 11, 2);
          	}
          	else{ 
			SendClientMessage(playerid,-1,"You are not have 500+ score for select this class.");
			return ShowPlayerDialog(playerid,DIALOG_CLASSSELECT,DIALOG_STYLE_LIST,"Select Class","ASSAULT\nSNIPER\nMEDIC","Select","exit"); }
			}
		
		
		}
	
}
for /changeclass this?
Reply
#3

Quote:
Originally Posted by FplayerGR
Посмотреть сообщение
Код:
#define DIALOG_CLASSSELECT 3221



CMD:changeclass(playerid,params[]){
	#pragma unused params
	ShowPlayerDialog(playerid,DIALOG_CLASSSELECT,DIALOG_STYLE_LIST,"Select Class","ASSAULT\nSNIPER\nMEDIC","Select","exit");
	return 1;
}


ondialogresponse...

if(dialogid == DIALOG_CLASSSELECT){

	switch(listitem){
		case 0:{
			 TogglePlayerControllable(playerid, 1);
	        ResetPlayerWeapons(playerid);
	        GivePlayerWeapon(playerid, 31, 200);//m4
	        GivePlayerWeapon(playerid, 29, 100);//mp5
	        GivePlayerWeapon(playerid, 27, 100);//  combat
	        GivePlayerWeapon(playerid, 24, 70);//deagle
		}
		case 1:{
		
			TogglePlayerControllable(playerid, 1);
	        ResetPlayerWeapons(playerid);
	        GivePlayerWeapon(playerid, 23, 200);//silent pistol
	        GivePlayerWeapon(playerid, 34, 250);//sniper
	        GivePlayerWeapon(playerid, 29, 250);//mp5
	        GivePlayerWeapon(playerid, 4, 1);//knife
	        RemovePlayerMapIcon(playerid, 0);
         	SetPlayerColor(playerid,COLOR_TRANSPARENT_MAP);
		
		}
		case 2:{
		
			if(GetPlayerScore(playerid) >= 500){ 
          	TogglePlayerControllable(playerid, 1);
	  		ResetPlayerWeapons(playerid);
	 	    GivePlayerWeapon(playerid, 33, 200);
	  		GivePlayerWeapon(playerid, 22, 200);
	  		GivePlayerWeapon(playerid, 25, 200);
	  		GivePlayerWeapon(playerid, 11, 2);
          	}
          	else{ 
			SendClientMessage(playerid,-1,"You are not have 500+ score for select this class.");
			return ShowPlayerDialog(playerid,DIALOG_CLASSSELECT,DIALOG_STYLE_LIST,"Select Class","ASSAULT\nSNIPER\nMEDIC","Select","exit"); }
			}
		
		
		}
	
}
for /changeclass this?
not working :/
Reply
#4

just force spawn
you need to make SetSpawnInfo and SpawnPlayer
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)