SA-MP Forums Archive
Why this send message with random number ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Why this send message with random number ? (/showthread.php?tid=491072)



Why this send message with random number ? - barts - 29.01.2014

PHP код:
CMD:sex(playeridparams[])
{
    new 
string[128], playerb;
    if(
WhoreTime[playerid] > 0)
    {
    
format(stringsizeof(string), "You need to wait %d more seconds before offering sex to someone again."WhoreTime[playerid]);
    
SendClientMessage(playeridCOLOR_GREYstring);
    return 
1;
    }
    if(
PlayerInfo[playerid][pJob] != JOB_WHORE && PlayerInfo[playerid][pVIPJob] != JOB_WHORE) return SendClientMessage(playeridCOLOR_GREY"You are not a Whore.");
    if(
sscanf(params"us[32]d"playerbsexprice))
    {
        
SendClientMessage(playeridCOLOR_WHITE"[Usage]: /sex [playerid] [price]");
        return 
1;
    }
    if(!
IsPlayerNearPlayer(playeridplayerb5)) return SendClientMessage(playeridCOLOR_GREY"You can't give anything to someone from this disatance.");
    if(!
IsPlayerLoggedIn(playerb)) return SendClientMessage(playeridCOLOR_GREY"Invalid player specified.");
    if(
IsPlayerCuffed(playerid)) return SendClientMessage(playeridCOLOR_GREY"You can't do this right now.");
    
format(stringsizeof(string), " You have offered have sex with %s for $%d."RPN(playerb), sexprice);
    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
    
format(stringsizeof(string), " %s has offered you to have sex for $%d. (/asex) (/csex)"RPN(playerid), sexprice);
    
SendClientMessage(playerbCOLOR_LIGHTBLUEstring);
    
SexBy[playerb] = playerid;
    
Sex[playerb] = 0;
    return 
1;

Everytime i use it sends " You have offered have sex with %s for [RANDOM NUMBER]." Why is this ?


Re: Why this send message with random number ? - Shetch - 29.01.2014

Код:
if(sscanf(params, "ri", playerb, sexprice))