Help me please [URGENT]
#1

Код:
public SpeedCamsTimer(){
        new String[256], Float:tmpX, Float:tmpY;
        for(new i = 0; i < MAX_PLAYERS; i++){
                new State = GetPlayerState(i);
                if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i) && GetPlayerSpeed(i, true) > 0 && State == PLAYER_STATE_DRIVER){
                        for(new p = 0; p < MAX_SPEEDCAMS; p++){
                                tmpX = SpeedCams[p][scx];
                                tmpY = SpeedCams[p][scy];
                                GetDirectedXY(2, p, tmpX, tmpY, 5.0, 1);
                                if(IsPlayerInRangeOfPoint(i, 20.0, tmpX, tmpY, SpeedCams[p][scz])){
                                        new CSpeed;
                                        CSpeed = GetPlayerSpeed(i, true);
                                        if(CSpeed > SpeedCams[p][scmaxspeed] && SpeedCamPlayer[i] == 0){
                                                SpeedCamPlayer[i] = 1;
												TextDrawShowForPlayer(i, radarTD[i]);
												SetTimerEx("RemoveRadarTD",1000, false, "i", i);
                                                format(String, sizeof(String), "You were cought on speed cam(%d/%d) ((Pay system in make))",CSpeed, SpeedCams[p][scmaxspeed]);
                                                SendClientMessage(i, COLOR_RED, String);
                                                SetTimerEx("SpeedCamCheck", 5000, false, "d", i);
                                        }
                                }
                        }
                }
        }
}



OK guys everything is ok here but when it says You were cought on speed cam it sends the message to the player ok i want is that someone can make something like when a person get's caught on speed cam the message should send to Cops i tried SendCopMessage but i don't think it works i mean it doesn't it stills show's to the player i also want that it should say the players name example
Garfield_Ram has been caught on a speed cam this message should be send to cops using SendCopMessage or some how i need the speed cam script fast please

(like %s Has been caught on a speec camera his name should be writen in %s and send to cop radio or some how it should also show to cops btw it is a rp server where i am gonna add it so tell me the script)


Thank you
Reply
#2

pawn Код:
format(String, sizeof(String), "You were cought on speed cam(%d/%d) ((Pay system in make))",CSpeed, SpeedCams[p][scmaxspeed]);
                                                SendClientMessage(i, COLOR_RED, String);
                                                SetTimerEx("SpeedCamCheck", 5000, false, "d", i);
to

pawn Код:
format(String, sizeof(String), "You were cought on speed cam(%d/%d) ((Pay system in make))",CSpeed, SpeedCams[p][scmaxspeed]);
SendClientMessage(i, COLOR_RED, String);
format(String, sizeof(String), "Speed Cam: (%d/%d) ((Pay system in make))",CSpeed, SpeedCams[p][scmaxspeed])
SendCopMessage(string);
SetTimerEx("SpeedCamCheck", 5000, false, "d", i);
?

I didn't add the player's name, because it's up to you. I wouldn't recommend it for an RP server because it would result in metagaming the name :P
Reply
#3

Quote:
Originally Posted by Mattakil
Посмотреть сообщение
pawn Код:
format(String, sizeof(String), "You were cought on speed cam(%d/%d) ((Pay system in make))",CSpeed, SpeedCams[p][scmaxspeed]);
                                                SendClientMessage(i, COLOR_RED, String);
                                                SetTimerEx("SpeedCamCheck", 5000, false, "d", i);
to

pawn Код:
format(String, sizeof(String), "You were cought on speed cam(%d/%d) ((Pay system in make))",CSpeed, SpeedCams[p][scmaxspeed]);
SendClientMessage(i, COLOR_RED, String);
format(String, sizeof(String), "Speed Cam: (%d/%d) ((Pay system in make))",CSpeed, SpeedCams[p][scmaxspeed])
SendCopMessage(string);
SetTimerEx("SpeedCamCheck", 5000, false, "d", i);
?

I didn't add the player's name, because it's up to you. I wouldn't recommend it for an RP server because it would result in metagaming the name :P
just add name too please
Reply
#4

Quote:
Originally Posted by GarfieldRam
Посмотреть сообщение
just add name too please
Here u go. I think u wanted this name:

Код:
format(String, sizeof(String), "You were cought on speed cam(%d/%d) ((Pay system in make))",CSpeed, SpeedCams[p][scmaxspeed]);
SendClientMessage(i, COLOR_RED, String);
format(String, sizeof(String), "Speed Cam: Player %s was caught in speed cam (%d/%d) ((Pay system in make))",GetPlayerName(playerid)CSpeed, SpeedCams[p][scmaxspeed])
SendCopMessage(string);
SetTimerEx("SpeedCamCheck", 5000, false, "d", i);
Change the GetPlayerName variable to whatever ur script have
Reply
#5

Quote:
Originally Posted by ViciousRoleplay123
Посмотреть сообщение
Here u go. I think u wanted this name:

Код:
format(String, sizeof(String), "You were cought on speed cam(%d/%d) ((Pay system in make))",CSpeed, SpeedCams[p][scmaxspeed]);
SendClientMessage(i, COLOR_RED, String);
format(String, sizeof(String), "Speed Cam: Player %s was caught in speed cam (%d/%d) ((Pay system in make))",GetPlayerName(playerid)CSpeed, SpeedCams[p][scmaxspeed])
SendCopMessage(string);
SetTimerEx("SpeedCamCheck", 5000, false, "d", i);
Change the GetPlayerName variable to whatever ur script have
D:\Real Life Roleplay all files\gamemodes\modernliferp.pwn(34954) : error 076: syntax error in the expression, or invalid function call
before 4 errors but after i added , after GetPlayerName it shows one error

Код:
SendClientMessage(i, COLOR_RED, String);
format(String, sizeof(String), "Speed Cam: Player %s was caught in speed cam (%d/%d) ((Pay system in make))",GetPlayerName, CSpeed, SpeedCams[p][scmaxspeed]);
SendCopMessage(COLOR_RED, String);
1 error

in my server it is GetPlayerName
Reply
#6

GetPlayerName must be used like this:
pawn Код:
new name[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
format(String, sizeof(String), "Speed Cam: Player %s was caught in speed cam (%d/%d) ((Pay system in make))", name, CSpeed, SpeedCams[p][scmaxspeed]);
SendCopMessage(COLOR_RED, String);
Reply
#7

Quote:
Originally Posted by iZN
Посмотреть сообщение
GetPlayerName must be used like this:
pawn Код:
new name[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
format(String, sizeof(String), "Speed Cam: Player %s was caught in speed cam (%d/%d) ((Pay system in make))", name, CSpeed, SpeedCams[p][scmaxspeed]);
SendCopMessage(COLOR_RED, String);
THank you very much
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)