06.12.2013, 00:44
Well i have this command which brings up a dialog when you do /buy, When i choose the Cellphone it restarts the server now for some reason since i got a new host. I have a NGRP edit's command for /buy
pawn Код:
if(dialogid == STOREMENU)
{
if(response)
{
if(listitem == 0)
{
if (GetPlayerCash(playerid) >= 500)
{
new randphone = 1000 + random(9999);//minimum 1000 max 9999
ReplacePH(PlayerInfo[playerid][pPnumber], randphone);
PlayerInfo[playerid][pPnumber] = randphone;
format(string, sizeof(string), "Cellphone purchased, your new phone number is %d.", randphone);
SendClientMessageEx(playerid, COLOR_GRAD4, string);
SendClientMessageEx(playerid, COLOR_GRAD5, "You can check this any time you wish by typing /stats.");
SendClientMessageEx(playerid, COLOR_WHITE, "HINT: You can now type /cellphonehelp to see your cellphone commands.");
if(PlayerInfo[playerid][pDonateRank] >= 1)
{
GivePlayerCash(playerid, -400);
SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You have received 20 percent off this product. Instead of paying $500, you paid $400.");
}
else
{
GivePlayerCash(playerid, -500);
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD4, "You don't have the cash for this item!");
}
}