Server closes when i type a CMD
#1

public OnPlayerCommandText(playerid, cmdtext[])
{

if (strcmp("/createemail", cmdtext, true, 10) == 0)
{

if(GetPlayerMoney(playerid) < 1000)

return SendClientMessage(playerid, 0xAFAFAFAA,"You don't have money enought.");

new email[32];

format(email,32,Local,Player(playerid));

if(dini_Exists(email))

return SendClientMessage(playerid, 0xAFAFAFAA,"You have a computer.");

dini_Create(email);

for(new i=0;i<sizeof(Emails);i++)

dini_Set(email,Emails[i],"Empyt");

GameTextForPlayer(playerid, "Cost: $1000", 5000, 1);
GivePlayerMoney(playerid, -2000);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, 0xAFAFAFAA, "Now you have an e-mail account.");

return 1;
}



I scripted an e-mail system but when i type the cmd /createemail the server close automatically. Could you help me to find the mistake?
Reply
#2

Can I see your define for "Local"?
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/createemail", cmdtext, true, 10) == 0)
    {
        if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, 0xAFAFAFAA,"You don't have money enought.");
        else
        {
            new email[32];
            format(email, 32, Local, Player(playerid));

            if(dini_Exists(email)) return SendClientMessage(playerid, 0xAFAFAFAA,"You have a computer.");

            dini_Create(email);

            for(new i=0;i<sizeof(Emails);i++)
            {
                dini_Set(email,Emails[i],"Empyt");
                GameTextForPlayer(playerid, "Cost: $1000", 5000, 1);
                GivePlayerMoney(playerid, -2000);
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                SendClientMessage(playerid, 0xAFAFAFAA, "Now you have an e-mail account.");
            }
        }
        return 1;
    }
    return 0;
}
Reply
#3

U're right, the local... i created the folders that was cited on FS and now it works (: thnx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)