[Pomoc] ProxDetector u komandi

20. Maj 2013. Zaključano
699
pregleda
7
postova
Robi031
4
Enforcer
20. Maj 2013.
Skripta koju koristim:Moj gm od 0
Detaljan opis problema:
Kako da u ovu komandu stavim proxDetector da znaci kad uzme drogu piše
Primjer
Robi_Corleone vadi te koristi drogu!

Dio skripte:
Komanda
CMD:usedrugs(playerid,params[])
{
    if(PlayerInfo > 1)
    {
        new Float:Health;
        GetPlayerHealth(playerid, Health);
        SetPlayerHealth(playerid, Health+5);
        PlayerInfo -= 1;
        SendClientMessage(playerid,-1,"{FF0000} Uzima te koristi drogu!");
    }
    else
    {
        SendClientMessage(playerid,-1,"{FF0000} Nemate droge!");
    }
    return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):
Master1
4
Made Man
20. Maj 2013.

CMD:usedrugs(playerid,params[])
{
  new pName;
    if(PlayerInfo > 1)
    {
        new Float:Health;
        GetPlayerHealth(playerid, Health);
        SetPlayerHealth(playerid, Health+5);
        PlayerInfo -= 1;
        format(string, sizeof(string), "%s  vadi te koristi drogu!", pname);
        RaplayProxDetector(20.0, playerid, string, 0x586433FF,0x586433FF,0x586433FF,0x586433FF,0x586433FF);
        SendClientMessage(playerid,-1,"{FF0000} Uzima te koristi drogu!");
    }
    else
    {
        SendClientMessage(playerid,-1,"{FF0000} Nemate droge!");
    }
    return 1;
}



ovo stavi pri kraju skripte
forward RaplayProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);

public RaplayProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
//radi = 2.0; //Trigger Radius
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{

GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SCM(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SCM(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SCM(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SCM(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SCM(i, col5, string);
}
}
}
}
Robi031
4
Enforcer
20. Maj 2013.
Zašto "Raplay"?
[WW]ivan
5
Kingpin
20. Maj 2013.
evo ga
CMD:usedrugs(playerid,params[])
{
    if(PlayerInfo > 1)
    {
        new Float:Health;
        GetPlayerHealth(playerid, Health);
        SetPlayerHealth(playerid, Health+5);
        PlayerInfo -= 1;
        SendClientMessage(playerid,-1,"{FF0000} Uzima te koristi drogu!");
new ime;
GetPlayerName(playerid, ime, sizeof(ime));
format(CmdString, 64, "** %s vadi te koristi drogu!", ime);
ProxDetector(10.0, playerid, string, boja,boja,boja,boja,boja);
    }
    else
    {
        SendClientMessage(playerid,-1,"{FF0000} Nemate droge!");
    }
    return 1;
}
[WW]ivan
5
Kingpin
20. Maj 2013.
Quote from May 20, 2013, 10:01 am:

CMD:usedrugs(playerid,params[])
{
  new pName;
    if(PlayerInfo > 1)
    {
        new Float:Health;
        GetPlayerHealth(playerid, Health);
        SetPlayerHealth(playerid, Health+5);
        PlayerInfo -= 1;
        format(string, sizeof(string), "%s  vadi te koristi drogu!", pname);
        RaplayProxDetector(20.0, playerid, string, 0x586433FF,0x586433FF,0x586433FF,0x586433FF,0x586433FF);
        SendClientMessage(playerid,-1,"{FF0000} Uzima te koristi drogu!");
    }
    else
    {
        SendClientMessage(playerid,-1,"{FF0000} Nemate droge!");
    }
    return 1;
}



ovo stavi pri kraju skripte
forward RaplayProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);

public RaplayProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
//radi = 2.0; //Trigger Radius
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{

GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SCM(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SCM(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SCM(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SCM(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SCM(i, col5, string);
}
}
}
}


nece ti valjat di ti iscitava ime i kaki raplay😕
sory na dp
Robi031
4
Enforcer
20. Maj 2013.
C:\Users\Brks\Desktop\SAMP\gamemodes\lob1.pwn(1074) : error 017: undefined symbol "CmdString"
C:\Users\Brks\Desktop\SAMP\gamemodes\lob1.pwn(1075) : error 017: undefined symbol "string"
Lucio
4
Enforcer
20. Maj 2013.
Trebat ce ti Foreach;
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
//radi = 2.0; //Trigger Radius
foreach(Player, i)
{
if(IsPlayerConnected(i))
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, string);
}
}
}
return 1;
}

CMD:usedrugs(playerid,params[])
{
    new ime, string;
    if(PlayerInfo > 1)
    {
        new Float:Health;
        GetPlayerName(playerid, ime, sizeof(ime));
        GetPlayerHealth(playerid, Health);
        SetPlayerHealth(playerid, Health+5);
        PlayerInfo -= 1;
        format(string, 64, "* %s vadi i smrce kokain.", ime);
        ProxDetector(10.0, playerid, string, boja, boja, boja, boja, boja);
        SendClientMessage(playerid,-1,"{FF0000} Uzima te koristi drogu!");
    }
    else
    {
        SendClientMessage(playerid,-1,"{FF0000} Nemate droge!");
    }
    return 1;
}


Evo ti i boja:
#define COLOR_PURPLE 0xC2A2DAAA

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha