09.10.2016, 10:14
Need help again. I think there's something wrong with my code. Please fix it for me, and tell me the things I did wrong. Thanks.
PHP код:
if(dialogid == DIALOG_LEARN)
{
if(response)
{
new string[90];
if(listitem == 0)
{
if(PlayerInfo[playerid][pLearn] > 0)
{
if(Skills[playerid][Unarmed] < 3)
{
PlayerInfo[playerid][pLearn] --;
Skills[playerid][Unarmed] ++;
format(string, sizeof(string), "SERVER: You have learned the Unarmed/Strength skill Rank %d. (/combatstyle)", Skills[playerid][Unarmed]);
SendClientMessage(playerid,COLOR_WHITE,string); }
else
{
SendClientMessage(playerid, COLOR_RED, "ERROR: You cannot spend any more learning points on Unarmed/Strength skill. You have mastered it.");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "ERROR: You don't have any Learning Points to spend.");
}
}
else if(listitem == 1)
{
if(PlayerInfo[playerid][pLearn] > 0)
{
if(Skills[playerid][Knife] < 5)
{
PlayerInfo[playerid][pLearn] --;
Skills[playerid][Knife] ++;
format(string, sizeof(string), "SERVER: You have learned the Knife skill Rank %d.", Skills[playerid][Knife]
SendClientMessage(playerid, COLOR_WHITE,string);
else
{
SendClientMessage(playerid, COLOR_RED, "ERROR: You cannot spend any more learning points on Unarmed/Strength skill. You have mastered it.");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "ERROR: You don't have any Learning Points to spend.");
}
}
return 1;
}