Class_Chosen{ playerid } = false;
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_CLASS1:
{
if(response)
{
switch(listitem)
{
case 0:
{
if(GetPlayerScore(playerid) < 150) SendClientMessage(playerid, COLOR_RED, "You need to have 150 score to use the Sniper class!");
Class_Chosen{ playerid } = false;
else //Line 493, error here.
SendClientMessage(playerid, COLOR_GREEN, "Sniper class chosen!");
SpawnPlayer(playerid);
ResetPlayerWeapons(playerid);
SetPlayerSkin(playerid, 285);
GivePlayerWeapon(playerid, 4, 1);
GivePlayerWeapon(playerid, 23, 500);
GivePlayerWeapon(playerid, 25, 150);
GivePlayerWeapon(playerid, 29, 850);
GivePlayerWeapon(playerid, 34, 500);
SetPlayerArmour(playerid, 99.0);
Class_Chosen{ playerid } = true;
}
case 1:
{
if(GetPlayerScore(playerid) < 150) return SendClientMessage(playerid, COLOR_RED, "You need to have 150 score to use the Medic class!");
Class_Chosen{ playerid } = false;
else //Line 510, error here.
SendClientMessage(playerid, COLOR_GREEN, "Medic class chosen!");
SendClientMessage(playerid, COLOR_GREEN, "You can use /heal to heal your teammates!");
SpawnPlayer(playerid);
ResetPlayerWeapons(playerid);
SetPlayerSkin(playerid, 275);
GivePlayerWeapon(playerid, 16, 1);
GivePlayerWeapon(playerid, 22, 257);
GivePlayerWeapon(playerid, 25, 350);
GivePlayerWeapon(playerid, 30, 550);
SetPlayerArmour(playerid, 99);
Class_Chosen{ playerid } = true;
}
case 2:
{
SendClientMessage(playerid, COLOR_GREEN, "Assault class chosen!");
SpawnPlayer(playerid);
ResetPlayerWeapons(playerid);
SetPlayerSkin(playerid, 287);
GivePlayerWeapon(playerid, 16, 3);
GivePlayerWeapon(playerid, 24, 320);
GivePlayerWeapon(playerid, 27, 180);
GivePlayerWeapon(playerid, 29, 500);
GivePlayerWeapon(playerid, 31, 500);
GivePlayerWeapon(playerid, 35, 1);
SetPlayerArmour(playerid, 99);
Class_Chosen{ playerid } = true;
}
case 3:
{
if(GetPlayerScore(playerid) < 300) return SendClientMessage(playerid, COLOR_RED, "You need to have 300 score to use the Engineer class");
Class_Chosen{ playerid } = false;
else //Line 542, error here.
SendClientMessage(playerid, COLOR_GREEN, "Engineer class chosen!");
SendClientMessage(playerid, COLOR_GREEN, "You can use /fix to repair your own vehicle, and /repair to repair your teammates vehicles");
SpawnPlayer(playerid);
ResetPlayerWeapons(playerid);
SetPlayerSkin(playerid, 50);
GivePlayerWeapon(playerid, 16, 1);
GivePlayerWeapon(playerid, 24, 157);
GivePlayerWeapon(playerid, 27, 127);
GivePlayerWeapon(playerid, 31, 540);
GivePlayerWeapon(playerid, 35, 2);
Class_Chosen{ playerid } = true;
}
}
}
return 1;
}
//Other scripts here
Class_Chosen[playerid] = false;
new bool:Class_Chosen[MAX_PLAYERS];
|
pawn Код:
pawn Код:
|
new
Class_Chosen[ MAX_PLAYERS char ]
;
|
Sorry for the possibly late answer.
The 0; and 1; is the same as true; and false; imo. cause i've tried using "0;" and "1;", but it gives me the same Error. |
new Class_Chosen[MAX_PLAYERS char];
Class_Chosen{ playerid } = 0;
new
bool: Class_Chosen[ MAX_PLAYERS char ]
;
Class_Chosen{ playerid } = false;
else //Line 510, error here.
SendClientMessage(playerid, COLOR_GREEN, "Medic class chosen!");
if(GetPlayerScore(playerid) < 150) SendClientMessage(playerid, COLOR_RED, "You need to have 150 score to use the Sniper class!");
//FORCES the player to choose the class on next death.
//Or just shows the dialog again, but same error
else
SendClientMessage(playerid, COLOR_GREEN, "Sniper class chosen!");
CMD:sc(playerid, params[]) {
Class_Chosen{ playerid } = false; //Sets the Class_Chosen to False, so after he dies, he will be able to change his class.
SendClientMessage(playerid, COLOR_ORANGE, "Switching class after the next death.");
return 1;
}