Remote function
#7

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
pawn Код:
public IsACop(playerid)
{
    if(!IsPlayerConnected(playerid)) return 0;
    switch(PlayerInfo[playerid][pLeader])
        case 1 .. 3, 5 .. 7, 11, 13: return 1;
    switch(PlayerInfo[playerid][pMember])
        case 1 .. 3, 5 .. 7, 11, 13: return 1;
    return 0;
}
pawn Код:
CheckPlayerSpeeding(playerid)
{
    // Check if the player hasn't been caught speeding recently
    if(APlayerData[playerid][PlayerCaughtSpeeding]) return APlayerData[playerid][PlayerCaughtSpeeding]--;
    if(IsACop(playerid)) return 1;
    // Loop through all speedcameras
    for(new CamID = 0; CamID < MAX_CAMERAS; CamID++)
    {
        // Check if this camera has been created
        if(ACameras[CamID][CamSpeed] != 0)
        {
            // Check if the player is the driver of the vehicle
            if(GetPlayerVehicleSeat(playerid) == 0)
            {
                // Check if the player's speed is greater than the speed allowed by this camera (no need to process a distance-check if not speeding)
                if(APlayerData[playerid][PlayerSpeed] > ACameras[CamID][CamSpeed])
                {
                    // Check if the player is near the camera
                    if(IsPlayerInRangeOfPoint(playerid, 20.0, ACameras[CamID][CamX], ACameras[CamID][CamY], ACameras[CamID][CamZ]))
                    {
                        APlayerData[playerid][PlayerCaughtSpeeding] = 20;
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Speed Cam has given you a ticket costing $2500, reason: High Speed");
                        GivePlayerCash(playerid, -2500);
                        break;
                    }
                }
            }
        }
    }
    return 1;
}
Fingers crossed.
Код:
D:\Alwil Software\Vas-Rps\gamemodes\VasRpV0.30Beta.pwn(6134) : error 001: expected token: "{", but found "case"
D:\Alwil Software\Vas-Rps\gamemodes\VasRpV0.30Beta.pwn(6135) : error 002: only a single statement (or expression) can follow each "case"
D:\Alwil Software\Vas-Rps\gamemodes\VasRpV0.30Beta.pwn(6135 -- 6136) : warning 215: expression has no effect
D:\Alwil Software\Vas-Rps\gamemodes\VasRpV0.30Beta.pwn(6136) : error 001: expected token: ";", but found "case"
D:\Alwil Software\Vas-Rps\gamemodes\VasRpV0.30Beta.pwn(6136) : error 014: invalid statement; not in switch
D:\Alwil Software\Vas-Rps\gamemodes\VasRpV0.30Beta.pwn(6136) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply


Messages In This Thread
Remote function [SOLVED] - by morha12 - 17.05.2014, 06:47
Re: Remote function - by KubiPL - 17.05.2014, 07:53
Re: Remote function - by morha12 - 17.05.2014, 08:08
Re: Remote function - by morha12 - 17.05.2014, 08:51
Re: Remote function - by morha12 - 17.05.2014, 09:14
Re: Remote function - by Threshold - 17.05.2014, 09:31
Re: Remote function - by morha12 - 17.05.2014, 09:46
Re: Remote function - by Threshold - 17.05.2014, 09:49
Re: Remote function - by morha12 - 17.05.2014, 09:53
Re: Remote function - by Pottus - 17.05.2014, 13:11

Forum Jump:


Users browsing this thread: 3 Guest(s)