/pay funktioniert nicht

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • CMD:pay(playerid, params[])
    {
    new giveplayerid, moneys, string[128];
    if(sscanf(params, "ud"),giveplayerid, moneys) return SyntaxMessage(playerid, "/pay [playerid/name] [amount]");
    if(moneys > 1000 && PlayerInfo[playerid][pLevel] < 3) return SendClientMessage(playerid, GREY, " You must be level 3 to pay more than $1,000 at a time.");
    if(moneys < 1 || moneys > 50000 && PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playerid, GREY, " You cannot pay under $1 or more than $50,000 at a time.");
    if(IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid == playerid) return SendClientMessage(playerid, GREY, " You cannot pay money to yourself.");
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    if(ProxDetectorS(5.0, playerid, giveplayerid))
    {
    new playermoney = PlayerInfo[playerid][pCash];
    if(moneys > 0 && playermoney >= moneys)
    {
    PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-moneys;
    GivePlayerMoney(playerid, (0 - moneys));
    PlayerInfo[giveplayerid][pCash] = PlayerInfo[giveplayerid][pCash]+moneys;
    GivePlayerMoney(giveplayerid, moneys);
    format(string, sizeof(string), " You have sent %s(player: %d), $%d.", pName(giveplayerid), giveplayerid, moneys);
    SendClientMessage(playerid, GREY1, string);
    format(string, sizeof(string), " You have recieved $%d from %s(player: %d).", moneys, pName(playerid), playerid);
    SendClientMessage(giveplayerid, GREY1, string);
    if(PlayerInfo[playerid][pMask] == 1) format(string, sizeof(string), "* Stranger takes out some Cash, and hands it to %s.",pName(giveplayerid));
    else format(string, sizeof(string), "* %s takes out some Cash, and hands it to %s.", pName(playerid),pName(giveplayerid));
    ProxDetector(30.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
    new plrIP[16];
    new giveplrIP[16];
    GetPlayerIp(playerid, plrIP, sizeof(plrIP));
    GetPlayerIp(giveplayerid, giveplrIP, sizeof(giveplrIP));
    format(string, sizeof(string), "%s (IP:%s) (Key:%d) (ConTime:%d) has paid $%d to %s (IP:%s) (Key:%d)", pName(playerid),plrIP,PlayerInfo[playerid][pKey], PlayerInfo[playerid][pConnectTime],moneys,pName(giveplayerid),giveplrIP,PlayerInfo[giveplayerid][pKey]);
    PayLog(string);
    }
    else return SendClientMessage(playerid, GREY1, "Invalid transaction amount.");


    }
    else return SendClientMessage(playerid, GREY, " You are too far away.");
    }
    }
    else { SendClientMessage(playerid, WHITE, " Not an active player!"); }
    return 1;
    }


    Immer wenn man ingame den Befehl nutzt, kommt die Meldung You cannot pay under $1 or more than $50,000 at a time.
    Also der Befehl tut mir das was er sollte.


    Kann mir da jemand helfen?
    Danke im Voraus! :D

  • Du musst nicht im Editor, sondern im Quellcode schreiben ;)

  • ist es beabsichtigt , dass nur Admins AB Level 1337 den befehl nutzen dürfen ?
    Ich denke mal nicht oder ?


    if(moneys < 1 || moneys > 50000 &&
    PlayerInfo[playerid][pAdmin] < 1337) return
    SendClientMessage(playerid, GREY, " You cannot pay under $1 or more than
    $50,000 at a time.");



    So sollte es gehen:


    if(moneys < 1 || moneys > 50000 ) return
    SendClientMessage(playerid, GREY, " You cannot pay under $1 or more than
    $50,000 at a time.");


    Ps: beim nächstenmal bitte kein C&P sondern selber machen ;)


    Mfg

  • Niemand kann den Command nutzen ;/


    Probiere es mal so:


    CMD:pay(playerid, params[])
    {
    new pID, mon, string[128];
    if(sscanf(params, "ud",pID, mon)) return SyntaxMessage(playerid, "/pay [playerid/name] [amount]");
    if(mon > 1000 && PlayerInfo[playerid][pLevel] < 3) return SendClientMessage(playerid, GREY, " You must be level 3 to pay more than $1,000 at a time.");
    if(mon < 1 || mon > 50000 && PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playerid, GREY, " You cannot pay under $1 or more than $50,000 at a time.");
    if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, WHITE, " Not an active player!");
    if(pID == playerid) return SendClientMessage(playerid, GREY, " You cannot pay money to yourself.");
    if(!ProxDetectorS(5.0, playerid, pID)) return SendClientMessage(playerid, GREY, " You are too far away.");
    new playermoney = PlayerInfo[playerid][pCash];
    if(mon <= 0 || playermoney < mon) return SendClientMessage(playerid, GREY1, "Invalid transaction amount.");
    PlayerInfo[playerid][pCash] -= mon;
    GivePlayerMoney(playerid, -mon);
    PlayerInfo[pID][pCash] += mon;
    GivePlayerMoney(pID, mon);
    format(string, sizeof(string), " You have sent %s(player: %d), $%d.", pName(pID), pID, mon);
    SendClientMessage(playerid, GREY1, string);
    format(string, sizeof(string), " You have recieved $%d from %s(player: %d).", mon, pName(playerid), playerid);
    SendClientMessage(pID, GREY1, string);
    if(PlayerInfo[playerid][pMask] == 1) format(string, sizeof(string), "* Stranger takes out some Cash, and hands it to %s.",pName(pID));
    else format(string, sizeof(string), "* %s takes out some Cash, and hands it to %s.", pName(playerid),pName(pID));
    ProxDetector(30.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    PlayerPlaySound(pID, 1052, 0.0, 0.0, 0.0);
    new plrIP[16],giveplrIP[16];
    GetPlayerIp(playerid, plrIP, sizeof(plrIP)),GetPlayerIp(pID, giveplrIP, sizeof(giveplrIP));
    format(string, sizeof(string), "%s (IP:%s) (Key:%d) (ConTime:%d) has paid $%d to %s (IP:%s) (Key:%d)", pName(playerid),plrIP,PlayerInfo[playerid][pKey], PlayerInfo[playerid][pConnectTime],mon,pName(pID),giveplrIP,PlayerInfo[pID][pKey]);
    PayLog(string);
    return 1;
    }


    mfg. :thumbup:

    ast2ufdyxkb1.png


    Leute, lernt scripten und versucht mal lieber etwas selber zu schreiben, als es aus einem GF zu kopieren. :S