why wont this work ?
#1

i have probably got it totally wrong but here goes

if i type /overload i want it so that i must be in range of a place otherwise it wont work and will send the message ERROR: you are not in range of such a place

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{

            if(!strcmp(cmdtext, "/overload"))
    {
        if(IsPlayerInRangeOfPoint(playerid, 10.0, 1286, 836.40002441406, 4.9000000953674))
        SetPlayerWantedLevel( playerid, 2 );// change to what you like
        GameTextForPlayer(playerid, "~r~YOU ARE OVERLOADED~n~~g~AVOID THE POLICE", 3000, 3);//change to what you want between the ""
        PlayCrimeReportForPlayer(playerid, playerid, 16);
            }
            else
            {
            SendClientMessage(playerid, COLOR_WHITE, "You are not on a weigh bridge");
            }
            return 1;
            }
Reply
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/overload"))
    {
        if(IsPlayerInRangeOfPoint(playerid, 10.0, 1286, 836.40002441406, 4.9000000953674))
        {
            SetPlayerWantedLevel( playerid, 2 );// change to what you like
            GameTextForPlayer(playerid, "~r~YOU ARE OVERLOADED~n~~g~AVOID THE POLICE", 3000, 3);//change to what you want between the ""
            PlayCrimeReportForPlayer(playerid, playerid, 16);
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "You are not on a weigh bridge");
        }
    }
    return 1;
}
You just had your brackets a little mixed up, format your code properly and it's easier to see.
Reply
#3

thankyou i thought it would have been simple but imjust learning
Reply
#4

No problem, just keep your brackets in line with eachother and it's much easier to code and fix the code you've made
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)