[Pomoc] /megaphone

Započeo David003
21. Jan. 2013. Zaključano
429
pregleda
5
postova
David003
5
Underboss
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:
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: //
[EX:RP]N1XTON
5
Underboss
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;
}
David003
5
Underboss
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"
David003
5
Underboss
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);
Blaeks_Biofor
5
Forum Don
21. Jan. 2013.
nepotrebno se mucis, samo stavi da mu returna poruku
if(!IsPlayerInAnyVehicle....//i ovde da mu returna poruku

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha