Započeo David003
•21. Jan. 2013.• Zaključano[Pomoc] /megaphone
455
pregleda
5
postova
Underboss
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
570
Postovi:
117
Teme:
Pridružio se:Feb. 2012
21. Jan. 2013.
Skripta koju koristim: CSRP (moja)
Opis problema: Napravio sam komandu /megaphone i sve radi ali kako da stavim da samo kad je u vozilo da se moze koristit
Dio skripte:
Slika/Video: //
Opis problema: Napravio sam komandu /megaphone i sve radi ali kako da stavim da samo kad je u vozilo da se moze koristit
Dio skripte:
if(strcmp(cmd, "/megaphone", true) == 0 || strcmp(cmd, "/m", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new tmpcar = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext <= ' '))
{
idx++;
}
new offset = idx;
new result;
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext;
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/m)egaphone [megaphone chat]");
return 1;
}
if(gTeam == 2 || IsACop(playerid))
{
if(!IsACopCar(tmpcar))
{
if(PlayerInfo == 1 || PlayerInfo == 1 || PlayerInfo == 3 || PlayerInfo == 3)
{
new currank;
if(PlayerInfo == 1) { currank = "PD.Kadet"; }
else if(PlayerInfo == 2) { currank = "PD.Policajac"; }
else if(PlayerInfo == 3) { currank = "PD.Narednik"; }
else if(PlayerInfo == 4) { currank = "PD.Inspektor"; }
else if(PlayerInfo == 5) { currank = "PD.Porucnik"; }
else if(PlayerInfo == 6) { currank = "PD.Nacelnik "; }
else { currank = "PD.Kadet"; }
format(string, sizeof(string), "[%s %s:o< %s]", currank, sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo == 2||PlayerInfo == 2)
{
format(string, sizeof(string), "[Agent %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo == 3||PlayerInfo == 3)
{
format(string, sizeof(string), "[Casnik %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
printf("%s", string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Niste u policajskom vozilu!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Niste clan Tima!");
return 1;
}
}
return 1;
}Slika/Video: //
Underboss
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
604
Postovi:
76
Teme:
Pridružio se:Sep. 2012
21. Jan. 2013.
probaj vako
if(strcmp(cmd, "/megaphone", true) == 0 || strcmp(cmd, "/m", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new tmpcar = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext <= ' '))
{
idx++;
}
new offset = idx;
new result;
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext;
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/m)egaphone [megaphone chat]");
return 1;
}
if(gTeam == 2 || IsACop(playerid))
{
if(PlayerInfo == 1 || PlayerInfo == 1 || PlayerInfo == 3 || PlayerInfo == 3)
{
new currank;
if(PlayerInfo == 1) { currank = "PD.Kadet"; }
else if(PlayerInfo == 2) { currank = "PD.Policajac"; }
else if(PlayerInfo == 3) { currank = "PD.Narednik"; }
else if(PlayerInfo == 4) { currank = "PD.Inspektor"; }
else if(PlayerInfo == 5) { currank = "PD.Porucnik"; }
else if(PlayerInfo == 6) { currank = "PD.Nacelnik "; }
else { currank = "PD.Kadet"; }
format(string, sizeof(string), "[%s %s:o< %s]", currank, sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo == 2||PlayerInfo == 2)
{
format(string, sizeof(string), "[Agent %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(PlayerInfo == 3||PlayerInfo == 3)
{
format(string, sizeof(string), "[Casnik %s:o< %s]", sendername, result);
ProxDetector(60.0, playerid, string,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
printf("%s", string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Niste clan Tima!");
return 1;
}
}
return 1;
}Underboss
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
570
Postovi:
117
Teme:
Pridružio se:Feb. 2012
21. Jan. 2013.
Radi,jedino sto sad dobivam ovaj warning
C:\Users\David\Desktop\Croatia Sky RolePlay\gamemodes\CSRP.pwn(41477) : warning 204: symbol is assigned a value that is never used: "tmpcar"Underboss
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
240 / 250 XP
Početnik(0)
570
Postovi:
117
Teme:
Pridružio se:Feb. 2012
21. Jan. 2013.
David (Sabljak) A.k.A SABO(T) wrote on January 21, 2013, 7:41 pm:
Tmpcar nisi nigdje koristio nakon new
Koristio sam vise puta
new tmpcar = GetPlayerVehicleID(playerid);
Morate biti prijavljeni da biste odgovorili na ovu temu.
Prijava