[HELP] IsPlayerInArea|SetPlayerWanted
#21

I compiled it and haven't any error/warning...
Reply
#22

Quote:
Originally Posted by Ricardo187
Посмотреть сообщение
I compiled it and haven't any error/warning...
Bad for me

THIS wont compile, it got an "mismatch"
Reply
#23

...BuMp...

pawn Код:
#include <a_samp>
#include <foreach>

#define FILTERSCRIPT

#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_RED 0xFF0000AA

new pTimer_Check[MAX_PLAYERS];
new pSecondsInArea[MAX_PLAYERS];

forward CheckPInArea(playerid);
forward ResetVars();


public OnFilterScriptInit()
{
    SetTimer("ResetVars",1000,true);
}


public OnPlayerSpawn(playerid)
{
    pTimer_Check[playerid] = SetTimerEx("CheckPInArea", 1000, true, "i", playerid);
    pSecondsInArea[playerid] = 0;
    return 1;
}

public OnPlayerDeath(playerid)
{
    KillTimer(pTimer_Check[playerid]);
    pSecondsInArea[playerid] = 0;
    return 1;
}


public ResetVars()
    {
    foreach(Player,i)
    {
    if(pSecondsInArea[i]>=1)
    {
    pSecondsInArea[i]--;
    }
  }
}


public CheckPInArea(playerid)
{
    if(IsPlayerInArea(playerid, 917.74, 2043.3, 997.12, 2183) && !IsPlayerAdmin(playerid)) //X, Y, Z
    {
        if(pSecondsInArea[playerid] == 0)
        {
            SetPlayerWantedLevel(playerid, (GetPlayerWantedLevel(playerid) + 10));
            new wantedlevel;
            wantedlevel = GetPlayerWantedLevel(playerid);
            new tmp[64];
            new name[MAX_PLAYER_NAME];
            GetPlayerName(playerid, name, sizeof(name));

            format(tmp, sizeof(tmp), "%s has entered ARMY.", wantedlevel);
            SendClientMessageToAll(playerid, COLOR_LIGHTBLUE, tmp); //Problem here (Line 63)
           
            SendClientMessage(playerid, COLOR_RED, "Crime Commited");
            format(tmp, sizeof(tmp), "(TRASPASSING ARMY) Wanted level %i", wantedlevel);
            SendClientMessage(playerid, COLOR_RED, tmp);
            pSecondsInArea[playerid]+=75;
        }

    }
    return 1;
}


stock IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY)
{
    new Float:pX, Float:pY, Float:pZ;
    GetPlayerPos(playerid, pX, pY, pZ);
    if(pX >= MinX && pX <= MaxX && pY >= MinY && pY <= MaxY)
        return true;
    else
        return false;
}
ERROR:
pawn Код:
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\WantedInArea.pwn(63) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#24

ofcourse..
Код:
SendClientMessageToAll( COLOR_LIGHTBLUE, tmp); //Problem here (Line 63)
Reply
#25

pawn Код:
format(tmp, sizeof(tmp), "%s has entered ARMY.", wantedlevel);
            SendClientMessageToAll( COLOR_LIGHTBLUE, tmp); //Problem here (Line 63)
Then it says:

has entered ARMY.

But it should say:

*PlayerName|PlayerID* has entered ARMY.
Reply
#26

Код:
format(tmp, sizeof(tmp), "%s|%i has entered ARMY.",name, playerid);            SendClientMessageToAll( COLOR_LIGHTBLUE, tmp); //Problem here (Line 63)
Reply
#27

Quote:
Originally Posted by Larsey123IsMe
Посмотреть сообщение
That part looks like this now:
pawn Код:
public CheckPInArea(playerid)
{
    if(IsPlayerInArea(playerid, 917.74, 2043.3, 997.12, 2183) && !IsPlayerAdmin(playerid))
    { //X, Y, Z
        if(pSecondsInArea[playerid] == 0)
        {
            //Get & SetPlayerWanted
            SetPlayerWantedLevel(playerid, (GetPlayerWantedLevel(playerid) + 10));
            new wantedlevel;
            wantedlevel = GetPlayerWantedLevel(playerid);
            new tmp[64];
            //GetPlayerName
            new name[MAX_PLAYER_NAME];
            GetPlayerName(playerid, name, sizeof(name));
            //TextToShowForAll
            format(tmp, sizeof(tmp), "(TRASPASSING ARMY)%s, traspassing ARMY.", wantedlevel);
            SendClientMessageToAll(0xFF0000FF, tmp);
            //TextToShowForPlayer
            format(tmp, sizeof(tmp), "(TRASPASSING ARMY) Your wanted level is now: %i", wantedlevel);
            SendClientMessage(playerid, 0xFF0000FF, tmp);
            pSecondsInArea[playerid]+=75;
        }

    }
    return 1;
}
You didn't even do anything to it....
pawn Код:
public CheckPInArea(playerid)
{
    if(IsPlayerInArea(playerid, 917.74, 2043.3, 997.12, 2183) && !IsPlayerAdmin(playerid))
    { //X, Y, Z
        if(pSecondsInArea[playerid] == 0)
        {
            //Get & SetPlayerWanted
            SetPlayerWantedLevel(playerid, (GetPlayerWantedLevel(playerid) + 10));
            new wantedlevel;
            wantedlevel = GetPlayerWantedLevel(playerid);
            new tmp[64];
            //GetPlayerName
            new name[MAX_PLAYER_NAME];
            GetPlayerName(playerid, name, sizeof(name));
            //TextToShowForAll
            format(tmp, sizeof(tmp), "(TRASPASSING ARMY)%s, traspassing ARMY.", name);
            SendClientMessageToAll(playerid, 0xFF0000FF, tmp);
            //TextToShowForPlayer
            format(tmp, sizeof(tmp), "(TRASPASSING ARMY) Your wanted level is now: %i", wantedlevel);
            SendClientMessage(playerid, 0xFF0000FF, tmp);
            pSecondsInArea[playerid]+=75;
        }

    }
    return 1;
}
Reply
#28

Quote:
Originally Posted by armyoftwo
Посмотреть сообщение
Код:
format(tmp, sizeof(tmp), "%s|%i has entered ARMY.",name, playerid);            SendClientMessageToAll( COLOR_LIGHTBLUE, tmp); //Problem here (Line 63)
Thanks ^^
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)