04.05.2013, 13:51
pawn Код:
CMD:buysim(playerid, params[])
{//1
if(!IsPlayerInRangeOfPoint(playerid, 6, 920.421142, -1361.637084, 13.003659))
{//2
SendClientMessageEx(playerid,COLOR_GREY," You are not at the Telecom Company Arena!");
else if(GetPVarType(playerid, "Sim"))
{//3
SendClientMessageEx(playerid, COLOR_GREY, " You are already have Sim!");
return 1;
}//3
if (GetPlayerCash(playerid) >= 500)
{//4
PlayerInfo[playerid][pSim] = 1;
format(string, sizeof(string), "Sim purchased, you can now look up other player's numbers.");
SendClientMessageEx(playerid, COLOR_GRAD4, string);
SendClientMessageEx(playerid, COLOR_WHITE, "HINT: Type /call /sms /text /t.");
if(PlayerInfo[playerid][pDonateRank] >= 1)
{//5
GivePlayerCash(playerid, -400);
SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You have received 20 percent off this product. Instead of paying $500, you paid $400.");
}//5
else
{//6
GivePlayerCash(playerid, -500);
}//6
}//4
else
{//7
SendClientMessageEx(playerid, COLOR_GRAD4, "You don't have the cash for the Sim!");
}//7
}//2
}//1