12.10.2016, 12:06
They're like points so that you can upgrade your skills. Example:
PHP код:
if(dialogid == DIALOG_HLEARN)
{
if(response)
{
new string[90];
if(listitem == 0)
{
if(PlayerInfo[playerid][pLearn] > 0)
{
if(PlayerInfo[playerid][Unarmed] < 3)
{
PlayerInfo[playerid][pLearn] --;
PlayerInfo[playerid][Unarmed] ++;
format(string, sizeof(string), "SERVER: You have learned the Unarmed/Strength skill Rank %d.", PlayerInfo[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(PlayerInfo[playerid][Knife] < 5)
{
PlayerInfo[playerid][pLearn] --;
PlayerInfo[playerid][Knife] ++;
format(string, sizeof(string), "SERVER: You have learned the Knife skill Rank %d.", PlayerInfo[playerid][Knife]);
SendClientMessage(playerid, COLOR_WHITE,string);
}
else
{
SendClientMessage(playerid, COLOR_RED, "ERROR: You cannot spend any more learning points on Knife skill. You have mastered it.");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "ERROR: You don't have any Learning Points to spend.");
}
}
else if(listitem == 2)
{
if(PlayerInfo[playerid][pLearn] > 0)
{
if(PlayerInfo[playerid][Katana] < 5)
{
PlayerInfo[playerid][pLearn] --;
PlayerInfo[playerid][Katana] ++;
format(string, sizeof(string), "SERVER: You have learned the Katana skill Rank %d.", PlayerInfo[playerid][Katana]);
SendClientMessage(playerid, COLOR_WHITE,string);
}
else
{
SendClientMessage(playerid, COLOR_RED, "ERROR: You cannot spend any more learning points on Katana skill. You have mastered it.");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "ERROR: You don't have any Learning Points to spend.");
}
}
else if(listitem == 3)
{
if(PlayerInfo[playerid][pLearn] > 0)
{
if(PlayerInfo[playerid][Colt45] < 5)
{
PlayerInfo[playerid][pLearn] --;
PlayerInfo[playerid][Colt45] ++;
format(string, sizeof(string), "SERVER: You have learned the Colt 45 skill Rank %d.", PlayerInfo[playerid][Colt45]);
SendClientMessage(playerid, COLOR_WHITE,string);
}
else
{
SendClientMessage(playerid, COLOR_RED, "ERROR: You cannot spend any more learning points on Colt 45 skill. You have mastered it.");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "ERROR: You don't have any Learning Points to spend.");
}
}
else if(listitem == 4)
{
if(PlayerInfo[playerid][pLearn] > 0)
{
if(PlayerInfo[playerid][Tazer] < 5)
{
PlayerInfo[playerid][pLearn] --;
PlayerInfo[playerid][Tazer] ++;
format(string, sizeof(string), "SERVER: You have learned the Silenced Pistol/Tazer skill Rank %d.", PlayerInfo[playerid][Tazer]);
SendClientMessage(playerid, COLOR_WHITE,string);
}
else
{
SendClientMessage(playerid, COLOR_RED, "ERROR: You cannot spend any more learning points on Silenced Pistol/Tazer skill. You have mastered it.");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "ERROR: You don't have any Learning Points to spend.");
}
}
}
return 1;
}