COMMAND: /sex (+REP)
#1

Alright so I'm having a little trouble with my sex command in the script.

The following is the code of /sex.

PHP Code:
CMD:sex(playeridparams[])
{
    if(!
IsPlayerInAnyVehicle(playerid))
        {
            
SendClientMessageEx(playeridCOLOR_GREY"   You can only have Sex in a Car!");
            return 
1;
        }
        new 
Car GetPlayerVehicleID(playerid);
        new 
string[128], giveplayeridmoney;
        if(
sscanf(params"ud"giveplayeridmoney)) return SendClientMessageEx(playeridCOLOR_GREY"USAGE: /sex [player] [price]");
        if(
money || money 10000) { SendClientMessageEx(playeridCOLOR_GREY"   Price not lower then $1 or above $10,000!"); return 1; }
        if(
IsPlayerConnected(giveplayerid))
        {
            if(
giveplayerid != INVALID_PLAYER_ID)
            {
                if (
ProxDetectorS(8.0playeridgiveplayerid))
                {
                    if(
giveplayerid == playerid) { SendClientMessageEx(playeridCOLOR_GREY"You cannot have Sex with yourself!"); return 1; }
                    if(
IsPlayerInAnyVehicle(playerid) && IsPlayerInVehicle(giveplayeridCar))
                    {
                        if(
gettime() >= PlayerInfo[playerid][pSexTime])
                        {
                            
format(stringsizeof(string), "* You offered %s to have sex with you, for $%s."GetPlayerNameEx(giveplayerid), number_format(money));
                            
SendClientMessageEx(playeridCOLOR_LIGHTBLUEstring);
                            
format(stringsizeof(string), "* Whore %s has offered you to have sex with them, for $%s (type /accept sex) to accept."GetPlayerNameEx(playerid), number_format(money));
                            
SendClientMessageEx(giveplayeridCOLOR_LIGHTBLUEstring);
                            
SexOffer[giveplayerid] = playerid;
                            
SexPrice[giveplayerid] = money;
                            
PlayerInfo[playerid][pSexTime] = gettime()+60;
                        }
                        else
                        {
                            
SendClientMessageEx(playeridCOLOR_GRAD2" You have already had sex, wait for your reload time to finish!");
                            return 
1;
                        }
                    }
                    else
                    {
                        
SendClientMessageEx(playeridCOLOR_GREY"   You or the other person must be in a Car together!");
                        return 
1;
                    }
                }
                else
                {
                    
SendClientMessageEx(playeridCOLOR_GREY"That person isn't near you.");
                    return 
1;
                }
            }
        }
        else
        {
            
SendClientMessageEx(playeridCOLOR_GREY"Invalid player specified.");
            return 
1;
        }
    }

and then this is what its showing me with errors and warning.

Code:
./includes/commands.pwn(44643) : warning 217: loose indentation
./includes/commands.pwn(44648) : warning 217: loose indentation
./includes/commands.pwn(48765) : warning 209: function "cmd_sex" should return a value
./includes/commands.pwn(48766) : error 010: invalid function or declaration
Reply


Messages In This Thread
COMMAND: /sex (+REP) - by SkilledMaster - 07.03.2015, 04:09
Re: COMMAND: /sex (+REP) - by Ryan_Bowe - 07.03.2015, 04:13
Re: COMMAND: /sex (+REP) - by rickisme - 07.03.2015, 04:14
Re: COMMAND: /sex (+REP) - by Finnick - 07.03.2015, 04:16
Re: COMMAND: /sex (+REP) - by SkilledMaster - 07.03.2015, 04:17

Forum Jump:


Users browsing this thread: 1 Guest(s)