Septarul Posted February 9, 2019 Posted February 9, 2019 Am facut comenzile, dar nu stiu de ce nu imi returneaza atunci cand un player trece pe langa mine nu ma anunta cu ce viteza a trecut etc. Va las mai in jos comanda CMD:startradar(playerid, params[]) { if(!IsACop(playerid)) return SendClientMessage(playerid,COLOR_GREY, "Nu faci parte din departament."); if(OnDuty[playerid] != 1) return SendClientMessage(playerid,COLOR_LGREEN, "Eroare: Nu esti la datorie!"); if(!Copcar2(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid,COLOR_GREY, "Nu esti intr-o masina a factiunii."); if(Radaron[playerid] == 1) return SendClientMessage(playerid,-1, "Ai deja activat radaru."); new viteza,string[128]; if(sscanf(params, "d",viteza)) return SendClientMessage(playerid,COLOR_GREY, "USAGE: {FFFFFF}/startradar <Speed Limit>"); if(viteza > 200 || viteza < 40) return SendClientMessage(playerid,-1, "Viteza invalida (40-200)."); Radaron[playerid] = 1; Radarlimit[playerid] = viteza; TogglePlayerControllable(playerid, 0); format(string, sizeof(string), "Ai activat radarul. Viteza maxima: %d KM/H.",viteza); SendClientMessage(playerid,COLOR_YELLOW,string); return 1; } CMD:stopradar(playerid, params[]) { if(!IsACop(playerid)) return SendClientMessage(playerid,COLOR_GREY, "Nu faci parte din factiunea politiei."); if(Radaron[playerid] == 0) return SendClientMessage(playerid,COLOR_GREY, "Nu ai radarul activ."); Radaron[playerid] = 0; Radarlimit[playerid] = 0; SendClientMessage(playerid,COLOR_YELLOW,"Ai dezactivat radarul!"); TogglePlayerControllable(playerid, 1); return 1; } function CustomPickups() { new Float:oldposx, Float:oldposy, Float:oldposz; new string[564]; foreach(Player,i) { GetPlayerPos(i, oldposx, oldposy, oldposz); if(Radaron[i] == 1) { foreach(Player, o) { if(IsPlayerInRangeOfPoint(o, 30.0, oldposx, oldposy, oldposz) && GetPlayerState(o) == PLAYER_STATE_DRIVER && OnDuty[o] == 0) { new viteza = Carspeed(o); if(viteza > Radarlimit[i]) { new nameradar[25],nameradar1[25]; GetPlayerName(o,nameradar,sizeof(nameradar)); GetPlayerName(i,nameradar1,sizeof(nameradar1)); format(string, sizeof(string), "%s[ID:%d] is driving with %d km/h, Location: %s, Radar Limit: %d km/h!", nameradar,o,viteza,GetPlayerZone(o),Radarlimit[i]); SCM(i,0xf03337FF,string); format(string, sizeof(string), "You were caught by %s radar with %d km/h, Radar Limit: %d km/h.",nameradar1,viteza,Radarlimit[i]); SCM(o,0xf03337FF,string); } } } } } return 1; } stock Carspeed(playerid,mode = 1) { new Float:Velocity [3]; GetVehicleVelocity ( GetPlayerVehicleID ( playerid ) , Velocity [ 0 ] , Velocity [ 1 ] , Velocity [ 2 ] ) ; return IsPlayerInAnyVehicle ( playerid ) ? floatround ( ( ( floatsqroot ( ( ( Velocity [ 0 ] * Velocity [ 0 ] ) + ( Velocity [ 1 ] * Velocity [ 1 ] ) + ( Velocity [ 2 ] * Velocity [ 2 ] ) ) ) * ( !mode ? 105.0 : 170.0 ) ) ) * 1 ) : 0; } Sper sa primesc cat mai rapid rezolvarea. Multumesc pentru atentie!
0 MiritaXD Posted February 10, 2019 Posted February 10, 2019 CustomPickups Functia e atasata la un timer?
0 Septarul Posted February 11, 2019 Author Posted February 11, 2019 Nu , nu este atasata. Trebuie sa adaug la //Timers?
0 VipBo$$ Posted February 11, 2019 Posted February 11, 2019 (edited) new pickuptimer; La public OnGameModeInit, adaugi pickuptimer = SetTimer("CustomPickups", 1000, 1); Si la function GameModeExitFunc, adaugi KillTimer(pickuptimer); Edited February 11, 2019 by VipBo$$
0 MiritaXD Posted February 11, 2019 Posted February 11, 2019 Acum 2 ore, Septarul a spus: Nu , nu este atasata. Trebuie sa adaug la //Timers? Da
0 Septarul Posted February 11, 2019 Author Posted February 11, 2019 Primesc aceste erori C:\Users\Vasi\Desktop\burned.ro\gamemodes\wa-rpg.pwn(2267) : error 017: undefined symbol "p" C:\Users\Vasi\Desktop\burned.ro\gamemodes\wa-rpg.pwn(2267) : error 029: invalid expression, assumed zero C:\Users\Vasi\Desktop\burned.ro\gamemodes\wa-rpg.pwn(2267) : error 029: invalid expression, assumed zero C:\Users\Vasi\Desktop\burned.ro\gamemodes\wa-rpg.pwn(2267) : fatal error 107: too many error messages on one line si aceasta este linia la care le primesc pickuptimer = SetTimer("CustomPickups", 1000, 1);
0 Septarul Posted February 11, 2019 Author Posted February 11, 2019 Am rezolvat erorile, Erau din cauza ca am dat copypaste de aici direct in gm, asa ca le-am rescris manual si a mers. Va trimit mesaj imediat sa va zic daca a functionat!
0 Septarul Posted February 11, 2019 Author Posted February 11, 2019 Multumesc @MiritaXD si @VipBo$$ merge perfect sistemul, raman dator :*
Question
Septarul
Am facut comenzile, dar nu stiu de ce nu imi returneaza atunci cand un player trece pe langa mine nu ma anunta cu ce viteza a trecut etc. Va las mai in jos comanda
Sper sa primesc cat mai rapid rezolvarea. Multumesc pentru atentie!
9 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now