- 0
GM bhood hpq123 /spray
-
Similar Content
-
- 18 replies
- 2,667 views
-
- 3 replies
- 319 views
-
- 89 replies
- 31,045 views
-
- 7 replies
- 1,836 views
-
Vând cont bhood
By 07619,
- 2 replies
- 634 views
-
-
Recently Browsing 0 members
- No registered users viewing this page.
Question
TheGodfather
Salut, cand dau /spray si sunt 2 sau mai multi playeri, apare de mai multe ori mesajul ca mai este o persoana care desenaza pe acest perete, dar ne lasa pe amandoi sa desenam, gen animatia merge. Progresul nu se pune de la amandoi, cum as putea face ca doar un jucatori sa poata da /spray?
YCMD:spray(playerid, params[], help) {
return SCM(playerid, -1, "Nu poti folosi aceasta comanda in intervalul 00-08.");
new clanid = PlayerInfo[playerid][pClan], string[180];
if(clanid == 0) return SCM(playerid, COLOR_GREY, "Nu faci parte dintr-un clan!");
if(ClanDuty[playerid] == 0) return SCM(playerid,-1,"Nu esti la datorie!");
if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid, -1, "Nu poti folosi aceasta comanda atata timp cat esti intr-un vehicul!");
if(StartedSpray2[playerid] == 1) return true;
if(StartedSpray[playerid] == 0) ClanProces[playerid] = 0;
new hour,minute,second, year, month, day;
gettime(hour,minute,second);
getdate(year, month, day);
//if(hour >= 00 && hour <
for(new h = 0; h < MAX_SAFEZONES; h++) {
if(PlayerToPoint(8, playerid, GraffitiInfo[h][gfX], GraffitiInfo[h][gfY], GraffitiInfo[h][gfZ])) {
if(StartedSprayOn[playerid] != 0 && StartedSprayOn[playerid] != h) {} //SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti desena pe acest perete!");
else if(GraffitiInfo[h][gfOwned] == PlayerInfo[playerid][pClan]) SCM(playerid, COLOR_LGREEN, "Eroare: Acest perete este detinut de clanul tau!");
//else if(CountWallSpray(h) == 1) SCM(playerid, COLOR_LGREEN, "Eroare: Mai este o persoana care deseneaza pe acest perete!");
else {
if(StartedSpray[playerid] == 0) {
if(GraffitiInfo[h][gfOwned] == 0) format(string, sizeof(string), "Ai inceput sa scrii pe peretele cu id-ul %d, detinut de clanul: Server", h);
else format(string, sizeof(string), "Ai inceput sa scrii pe peretele cu id-ul %d, detinut de clanul: %s", h, ClanInfo[GraffitiInfo[h][gfOwned]][clName]);
SCM(playerid, COLOR_LIGHTBLUE, string);
GraffitiInfo[h][gfAttacked] = clanid;
format(string, sizeof(string), "{%s}%s (din clanul %s) a inceput sa deseneze pe peretele clanului tau (turf id %d).", ClanInfo[GraffitiInfo[h][gfOwned]][clColor], GetName(playerid), ClanInfo[PlayerInfo[playerid][pClan]][clName], h);
SendClanMessage(GraffitiInfo[h][gfOwned], string);
}
ApplyAnimation(playerid,"SPRAYCAN","spraycan_full",4.0,0,0,0,0,0);
PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0);
SetTimerEx( "FinalProces", 4000, 0, "d", playerid );
StartedSpray[playerid] = 1;
StartedSpray2[playerid] = 1;
StartedSprayOn[playerid] = h;
}
}
}
return true;
}
function CountWallSpray(id) {
foreach(Player, i) {
if(StartedSprayOn[i] == id) return true;
}
return false;
}
function FinalProces(playerid) {
if(IsPlayerConnected(playerid) && StartedSpray[playerid] == 1) {
ClearAnimations(playerid);
new string[180];
new test = 7 + random(6);
ClanProces[playerid] += test;
if(ClanProces[playerid] >= 100) {
new tagname[180];
new i = StartedSprayOn[playerid];
format(string, sizeof(string), "{%s}%s (din clanul %s) a reusit sa deseneze complet peretele (turf id %d).", ClanInfo[GraffitiInfo[i][gfOwned]][clColor], GetName(playerid), ClanInfo[PlayerInfo[playerid][pClan]][clName], i);
SendClanMessage(GraffitiInfo[i][gfOwned], string);
format(string, sizeof(string), "{%s}%s a reusit sa deseneze complet peretele (turf id %d).", ClanInfo[GraffitiInfo[i][gfOwned]][clColor], GetName(playerid), i);
SendClanMessage(PlayerInfo[playerid][pClan], string);
GraffitiInfo[i][gfOwned] = PlayerInfo[playerid][pClan];
DestroyDynamicObject(GraffitiInfo[i][gfObject]);
GraffitiInfo[i][gfObject] = CreateDynamicObject(19353, GraffitiInfo[i][gfX], GraffitiInfo[i][gfY], GraffitiInfo[i][gfZ], 0.0, 0.0, GraffitiInfo[i][gfRot]);
format(tagname, sizeof(tagname), "{%s}%s\n%s", ClanInfo[GraffitiInfo[i][gfOwned]][clColor], ClanInfo[GraffitiInfo[i][gfOwned]][clName], ClanInfo[GraffitiInfo[i][gfOwned]][clTag]);
SetDynamicObjectMaterialText(GraffitiInfo[i][gfObject], 0, tagname, OBJECT_MATERIAL_SIZE_512x256, "BankGothic Md BT", 60, 1, 0xfff0f0f0, 0, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
GraffitiInfo[StartedSprayOn[playerid]][gfAttacked] = 0;
new query[256];
mysql_format(SQL, query, sizeof(query), "UPDATE `graffiti` SET `Owned`='%d' WHERE `ID`='%d'", PlayerInfo[playerid][pClan], i);
mysql_tquery(SQL, query, "", "");
StartedSpray[playerid] = 0;
StartedSpray2[playerid] = 0;
StartedSprayOn[playerid] = 0;
}
else {
format(string, sizeof(string), "Continua sa desenezi peretele! (%d%s)", ClanProces[playerid], "%%");
SCM(playerid, COLOR_GOLD, string);
}
StartedSpray2[playerid] = 0;
}
return true;
}
7 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.