Little Little Help here.!
#1

pawn Код:
forward AirBreak();

IsVehicleAir(playerid, vehicleid)
{
    vehicleid = GetPlayerVehicleID(playerid);
    switch(GetVehicleModel(vehicleid))
    {
        case 592, 577, 511, 512, 593, 520, 553, 476, 519, 460, 513, 548, 425, 417, 487, 488, 498, 563, 447, 469: return true;
    }
    return false;
}

public AirBreak()
{
    foreach (Player, i)
    {
        new Float:X, Float:Y, Float:Z, Float:ZM, Float:difference;
        GetPlayerPos(i,X,Y,Z); //Get the players position
        MapAndreas_FindZ_For2DCoord(X,Y,ZM); //Gets the max Z cord
        difference = Z-ZM;

        if(!IsVehicleAir(i, GetPlayerVehicleID(i)))
        {
            if (difference > 100 && GetPlayerState(i) == PLAYER_STATE_PASSENGER || GetPlayerState(i) == PLAYER_STATE_DRIVER)
            {
                //Do something here, like send a warning to admins or ban the player
            }
            //If players Z cord is more than 100 meters above the ground
            if(difference > 10 && GetPlayerState(i) == PLAYER_STATE_ONFOOT)
            {
                new pname[MAX_PLAYER_NAME];
                GetPlayerName(playerid,pname,sizeof(pname));

                new reason[128];
                format(reason,sizeof(reason),"%s has typed /admins he might hack now, Please check him.",pname);
                SendClientMessageToAdmins(RED, reason, 1);
            }
        }
    }
}
pawn Код:
C:\Users\Alex\Desktop\CodSamp\gamemodes\COD5.pwn(137) : error 017: undefined symbol "playerid"
Reply
#2

pawn Код:
public AirBreak()
{
    foreach (Player, i)
    {
        new Float:X, Float:Y, Float:Z, Float:ZM, Float:difference;
        GetPlayerPos(i,X,Y,Z); //Get the players position
        MapAndreas_FindZ_For2DCoord(X,Y,ZM); //Gets the max Z cord
        difference = Z-ZM;

        if(!IsVehicleAir(i, GetPlayerVehicleID(i)))
        {
            if (difference > 100 && GetPlayerState(i) == PLAYER_STATE_PASSENGER || GetPlayerState(i) == PLAYER_STATE_DRIVER)
            {
                //Do something here, like send a warning to admins or ban the player
            }
            //If players Z cord is more than 100 meters above the ground
            if(difference > 10 && GetPlayerState(i) == PLAYER_STATE_ONFOOT)
            {
                new pname[MAX_PLAYER_NAME];
                GetPlayerName(i,pname,sizeof(pname));

                new reason[128];
                format(reason,sizeof(reason),"%s has typed /admins he might hack now, Please check him.",pname);
                SendClientMessageToAdmins(RED, reason, 1);
            }
        }
    }
}
Reply
#3

Or you can add playerid to the forward and the public and there you go .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)