30.07.2014, 21:06
PHP код:
if(strcmp(cmd, "/buyws", true) == 0)
{
new stringa[256]; // String.
if(IsPlayerConnected(playerid) == 1) // Checks if player is connected.
{
new points[248]; // Points.
new nxtlevel = PlayerInfo[playerid][pWS]+1; // As soon as its executed, It adds +1 to your score.
new expamount = nxtlevel*3; // Exp amount, Its 2 CURRENTLY but you can raise it by adding +number after levelex
if(PlayerInfo[playerid][pWS] == 10)
}
else
{
format(points,sizeof(points)," Трябват ти %d XP, а в момента имаш %d!", expamount, PlayerInfo[playerid][Exp]); // Format, This is pretty obvious.
SendClientMessage(playerid,COLOR_GRAD1,points); // Sends the message
}
if(PlayerInfo[playerid][Exp] < expamount) // Checks if player's exp amount is above the required one or not.
{
format(points,sizeof(points)," Трябват ти %d XP, а в момента имаш %d!", expamount, PlayerInfo[playerid][Exp]); // Format, This is pretty obvious.
SendClientMessage(playerid,COLOR_GRAD1,points); // Sends the message
return 1;
}
else
{
PlayerInfo[playerid][Exp] -= expamount; // Sets the EXP amount to 0 as you level'd up.
PlayerInfo[playerid][pWS]++; // Adds a level.
format(stringa,sizeof(stringa),"Честито!Ти вдигна твоя Weapon skill на %d!", PlayerInfo[playerid][pWS]); // Format.
SendClientMessage(playerid,COLOR_ORANGE,stringa); // Sends the message.
return 1;
}
}
return 1;
}