Jump to content
    Bine ai venit pe comunitatea 1TAP ROMANIA!

Citeste regulamentul comunitatii pentru a evita toate incidentele neplacute!

REGULAMENT

Te plictisesti? Te invitam pe serverele noastre!

SERVERE COMUNITARE

Acceptam servere de orice tip!

CERERE DNS

Linkuri utile

FreakHosting
FreakHosting
FreakHosting
FreakHosting
FreakHosting
Sign in to follow this  
Impulsive.

[Tutorial] Rainbow Car

Recommended Posts

Bun pentru inceput, avem nevoie de o variabila de timer.

new TimerRainCar[MAX_PLAYERS];

Apoi mergem si la public OnPlayerDisconnect(playerid, reason) sa adaugam Timer-ul.

public OnPlayerDisconnect(playerid, reason){
	KillTimer(TimerRaiCar[playerid]);
}

Dupa ce am facut variabila si am adaugat timerul in OnPlayerDisconnect, sa facem comanda.

CMD:rainbowcar(playerid, params[]){
	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
	if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid, -1, "Nu te aflii intr-un vehicul.");
	new time;
	if(sscanf(params, "i", time)) return SCM(playerid, COLOR_GREEN, "Sintaxa: {FFFFFF}/rainbowcar <time>");
	if(time < 0) return 1;
	KillTimer(TimerRainCar[playerid]);
	TimerRainCar[playerid] = SetTimerEx("RainbowChange", time, true, "i", playerid);
	return 1;
}
CMD:stoprainbow(playerid, params[]){
	if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    KillTimer(TimerRainCar[playerid]);
    SCM(playerid, COLOR_GREEN, "Ai oprit Ranbowcar!");
    return 1;
}

Dupa ce am facut si comenzile haideti sa facem si functia pentru a fi treaba treaba.

function RainbowChange(playerid){
	if(IsPlayerInAnyVehicle(playerid)){
	    new c1 = random(255), c2= random (255);
	    ChangeVehicleColor(GetPlayerVehicleID(playerid), c1, c2);
 	}
 	return 1;
}

O mica observatie!

Aceasta este doar baza comenzi rainbow, de aici puteti voi sa ii adaugati sa aveti nevoie de puncte pentru a o folosi, sa fie valabila doar pentru admini/helperi/vip sau fiecare dupa preferinte.

Share this post


Link to post
Share on other sites
CS MONEY

Multumim . T/C

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  



Theme made by CodeBite & raduly for 1TAP COMMUNITY!

Comunitatea 1TAP Romania

Comunitatea 1TAP ROMANIA a fost infiintata cu scopul de a atrage jucatorii de Counter Strike:Global Offensive si nu numai, pentru a le oferi un mediu mai bun si placut unde sa isi petreaca timpul liber alaturi de prietenii lor!

Ne-am facut recunoscuti prima data prin serverul nostru LOCUL 1 in Romania, "ARENA.1TAP.RO", si odata cu timpul ne-am extins si cu serverul de FiveM, ajungand locul 1 si el!


Copyright 2020 © FREAK Powered by Invision Community

×
×
  • Create New...