/Pullover
#1

Hello,

I have copied this from another command in the script I'm using

http://pastebin.com/GJk1BwCE

I want to be able to just do /pullover and it will admit that text out but at the moment you have to enter text for it to appear. If you can help me it would be much appreciated.

-Moehq-
Reply
#2

This is just a thought, look at the /s command and then maybe use that but just alter the color and the text..
Reply
#3

You still have to enter text. So not what I'm looking to do.
Reply
#4

I think i understand what you mean.

You want to be able to just do /pullover instead of /pullover [param]

If so; replace:
pawn Код:
if(isnull(params)) return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/pullover");
                        else if (!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You're not in a vehicle.");
With:

pawn Код:
if (!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You're not in a vehicle.");
If i'm correct, isnull(params) is checking to see if your command has any text with it (E.G: /pullover [text]).
Reply
#5

No he means if he does /pullover it will write: "this is the SFSD, pull the vehicle over and shut off the engine" rather than typing it.
Reply
#6

Yeah thats what i mean, and thats what the command (that he posted) sort of does.

pawn Код:
format(textString, sizeof(textString), "(megaphone) %s says: This is the LSPD, please pull over. Turn off your engine and remain seated.", szPlayerName, params);
(Didn't notice - also have to remove the "params" from the format)
Reply
#7

Here is my code
http://pastebin.com/pAbWywpX
here are my errors
pawn Код:
C:\Users\Michelle\Downloads\Windows\Windows\gamemodes\vx-rp.pwn(543) : warning 217: loose indentation
C:\Users\Michelle\Downloads\Windows\Windows\gamemodes\vx-rp.pwn(4019) : warning 217: loose indentation
C:\Users\Michelle\Downloads\Windows\Windows\gamemodes\vx-rp.pwn(4022) : warning 217: loose indentation
C:\Users\Michelle\Downloads\Windows\Windows\gamemodes\vx-rp.pwn(4022) : error 017: undefined symbol "textString"
C:\Users\Michelle\Downloads\Windows\Windows\gamemodes\vx-rp.pwn(4022) : warning 215: expression has no effect
C:\Users\Michelle\Downloads\Windows\Windows\gamemodes\vx-rp.pwn(4022) : error 001: expected token: ";", but found "]"
C:\Users\Michelle\Downloads\Windows\Windows\gamemodes\vx-rp.pwn(4022) : error 029: invalid expression, assumed zero
C:\Users\Michelle\Downloads\Windows\Windows\gamemodes\vx-rp.pwn(4022) : fatal error 107: too many error messages on one line
Reply
#8

pawn Код:
CMD:pullover(playerid, params[])
{
    if(playerVariables[playerid][pStatus] >= 1)
    {
        if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1)
        {
            if (!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You're not in a vehicle.");
            new
                queryString[255], // <---- you forget the comma
                textString[128];

            GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
            format(textString, sizeof(textString), "(megaphone) %s says: This is the LSPD, please pull over. Turn off your engine and remain seated.", szPlayerName);
            nearByMessage(playerid, COLOR_HOTORANGE, textString, 50.0);


            mysql_real_escape_string(textString, textString);

            format(queryString, sizeof(queryString), "INSERT INTO chatlogs (value, playerinternalid) VALUES('%s', '%d')", textString, playerVariables[playerid][pInternalID]);
            mysql_query(queryString);
        }
        else SendClientMessage(playerid, COLOR_GREY, "You're not a law enforcement officer.");
    }
    return 1;
}
Reply
#9

Thank you so so much,
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)