PDA

View Full Version : /buy Cellphone


AchievementMaster360
06/12/2013, 01:44 AM
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

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!");
}
}

DavidLuango
06/12/2013, 02:38 AM
Most likely your SAMP-Sever.exe is crashing. Go ahead take look at server.log.txt.

AchievementMaster360
22/12/2013, 09:35 PM
Most likely your SAMP-Sever.exe is crashing. Go ahead take look at server.log.txt.

Nothing is showing up on the logs, It just stops working then i have to launch the server up again.

TheOriginal1337
22/12/2013, 09:41 PM
Outdated plugins maybe? I don't really see what's wrong in the code.