error with command /pay
#1

pawn Код:
if(strcmp(cmd, "/pay", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "/pay [playerid/PartOfName] [amount]");
                return 1;
            }
            //giveplayerid = strval(tmp);
        giveplayerid = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "/pay [playerid/PartOfName] [amount]");
                return 1;
            }
            new moneys,playermoney;
            moneys = strval(tmp);
            if(PlayerInfo[playerid][pAdmin] < 1)
            {
                if(moneys > 999999999 && PlayerInfo[playerid][pLevel] < 5)
                {
                    SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "You need to be level 5 to make that transition.");
                    return 1;
                }
            }
            if(moneys < 1 || moneys > 999999999)
            {
              SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Invбlid Ammount");
              return 1;
            }
            if (IsPlayerConnected(giveplayerid))
            {
              if(giveplayerid != INVALID_PLAYER_ID)
              {
                    if (ProxDetectorS(5.0, playerid, giveplayerid))
                    {
                      if(giveplayerid != playerid)
                      {
                            playermoney = GetPlayerCash(playerid);
                            if (moneys > 0 && playermoney >= moneys)
                            {
                                GivePlayerCash(playerid, (0 - moneys));
                                GivePlayerCash(giveplayerid, moneys);
                                format(string, sizeof(string), "You gave %s(Player: %d), %d$.", moneys, GetPlayerNameEx(giveplayerid),giveplayerid);
                                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                                SendClientMessage(playerid, COLOR_WHITE, string);
                                format(string, sizeof(string), "You recieved %d$ from %s(Player: %d).",GetPlayerNameEx(playerid), playerid,moneys);
                                SendClientMessage(giveplayerid, COLOR_WHITE, string);
                                format(string, sizeof(string), "%s payed %d$ a %s", GetPlayerNameEx(playerid), moneys, GetPlayerNameEx(giveplayerid));
                                PayLog(string);
                                PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
                                PlayerPlayerActionMessage(playerid,giveplayerid,5.0,"%s takes out his wallet and gives some cash to %s.");
                            }
                            else
                            {
                                SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Invбlid ammount");
                            }
                        }
                    else
                        {
                            SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "You can't pay to yourself dumbass!");
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "You're to far away.");
                    }
                }//invalid id
            }
            else
            {
                SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Invбlid ID");
            }
        }
        return 1;
    }
for some reason this command is crashing my server, not my game, but my server, is there any error?
Reply
#2

no1?
Reply
#3

Damn, anyone?
Reply
#4

alo?
Reply
#5

post the function from PlayerPlayerActionMessage(playerid,giveplayerid,5. 0,"%s takes out his wallet and gives some cash to %s.");
Reply
#6

pawn Код:
public PlayerPlayerActionMessage(playerid,targetid,Float:radius,message[])
{
    //This is for messages like "Blah has opened the door for Steve".
    new string[128];
    format(string, sizeof(string), "%s %s %s.", GetPlayerNameEx(playerid), message,GetPlayerNameEx(targetid));
    ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    PlayerActionLog(string);
    return 1;
}

I use this fuction to other comands at they dont crash my server :/
Reply
#7

Still waiting...
Reply
#8

Stop these tripple posting..

Go to GF topic.
Reply
#9

It's not GF damit, if i'm posting because this sh1t crash my server.

But its i'll not post for this anymore.
Reply
#10

It doesn't matter if your game mode is not GF. This command is taken from GF.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)