Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: Nadroj poslato Mart 03, 2013, 18:45:45 POSLE PODNE

Naslov: chat
Poruka od: Nadroj poslato Mart 03, 2013, 18:45:45 POSLE PODNE
Nov sam i ucim tako sto pisem od osnovnih kodova vece kodove i unapredjene.

da li neko moze da mi napise najosnovniji kod za chat i da je distanca 200.0
Naslov: Odg: chat
Poruka od: FlasH poslato Mart 03, 2013, 18:48:27 POSLE PODNE

ÄŒitaj pravila ovog podforuma Ovdje (http://balkan-samp.com/forum/index.php?topic=11453.0)

COMMAND:b(playerid, params[], help)
{
    if(isnull(params)) return SCM(playerid,COLOR_RED," /b [Text]"); // Kucanje komande
    new string[128]; // Oznacis string koji dolje koristimo
    format(string,sizeof(string), "ooc chat | %s:(( %s ))", GetName(playerid), params); // salje poruku
    ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); // Znaci da vidi sam tvoje okruzenje
    return 1;
}
Naslov: Odg: chat
Poruka od: Nadroj poslato Mart 03, 2013, 19:15:17 POSLE PODNE
Da znam pravila ovog foruma ali ovde ce biti razne stvari na jednom mestu koje ce mi trebati nece samo ovo biti...
Naslov: Odg: chat
Poruka od: Nadroj poslato Mart 03, 2013, 19:16:55 POSLE PODNE
uzgred ...

C:\Users\petarwin7\Desktop\Grand Line\gamemodes\GL.pwn(143) : error 017: undefined symbol "b"
C:\Users\petarwin7\Desktop\Grand Line\gamemodes\GL.pwn(145) : error 017: undefined symbol "isnull"
C:\Users\petarwin7\Desktop\Grand Line\gamemodes\GL.pwn(145) : error 017: undefined symbol "SCM"
C:\Users\petarwin7\Desktop\Grand Line\gamemodes\GL.pwn(147) : error 017: undefined symbol "GetName"
C:\Users\petarwin7\Desktop\Grand Line\gamemodes\GL.pwn(148) : error 017: undefined symbol "ProxDetector"
C:\Users\petarwin7\Desktop\Grand Line\gamemodes\GL.pwn(151) : warning 225: unreachable code
C:\Users\petarwin7\Desktop\Grand Line\gamemodes\GL.pwn(143) : warning 203: symbol is never used: "COMMAND"
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
Naslov: Odg: chat
Poruka od: FlasH poslato Mart 03, 2013, 19:28:02 POSLE PODNE
Citat: ladolez poslato Mart 03, 2013, 19:16:55 POSLE PODNE
uzgred ...

C:\Users\petarwin7\Desktop\Grand Line\gamemodes\GL.pwn(143) : error 017: undefined symbol "b"
C:\Users\petarwin7\Desktop\Grand Line\gamemodes\GL.pwn(145) : error 017: undefined symbol "isnull"
C:\Users\petarwin7\Desktop\Grand Line\gamemodes\GL.pwn(145) : error 017: undefined symbol "SCM"
C:\Users\petarwin7\Desktop\Grand Line\gamemodes\GL.pwn(147) : error 017: undefined symbol "GetName"
C:\Users\petarwin7\Desktop\Grand Line\gamemodes\GL.pwn(148) : error 017: undefined symbol "ProxDetector"
C:\Users\petarwin7\Desktop\Grand Line\gamemodes\GL.pwn(151) : warning 225: unreachable code
C:\Users\petarwin7\Desktop\Grand Line\gamemodes\GL.pwn(143) : warning 203: symbol is never used: "COMMAND"
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
Očito da ne znaš pravila kada radiš DP.
Aha,radiš Gm od 0.

Ovako:

na vrh skroz:


#include <zcmd> // taj include stavi u pawno/include folder

Na vrhu definiraj:

#define SCM SendClientMessage

Dodaj stock i funkciju ovako:

function ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new BigEar[MAX_PLAYERS];
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
{
if(!BigEar[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);
}
}
else
{
SendClientMessage(i, col1, string);
}
}
}
}
return 1;
}

stock GetName(playerid)
{
new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    for(new i = 0; i < MAX_PLAYER_NAME; i++)
    {
        if(name[i] == '_') name[i] = ' ';
    }
    return name;
}

Naslov: Odg: chat
Poruka od: Nadroj poslato Mart 03, 2013, 20:18:19 POSLE PODNE
da mod radim od 0 kako bih se vise mucio da naucim nesto... uzgred...

C:\Users\petarwin7\Desktop\Grand Line\gamemodes\GL.pwn(9) : fatal error 100: cannot read from file: "zcmd"

i takodje redovno posecuj ovu temu posto vidim da ces mi trebati i da cu te smarati jos DUGO :)
Naslov: Odg: chat
Poruka od: FlasH poslato Mart 03, 2013, 20:20:05 POSLE PODNE
Citat: ladolez poslato Mart 03, 2013, 20:18:19 POSLE PODNE
da mod radim od 0 kako bih se vise mucio da naucim nesto... uzgred...

C:\Users\petarwin7\Desktop\Grand Line\gamemodes\GL.pwn(9) : fatal error 100: cannot read from file: "zcmd"

i takodje redovno posecuj ovu temu posto vidim da ces mi trebati i da cu te smarati jos DUGO :)

Ubaci ZCMD include u datoteku: PAWNO PA U FILDER INCLUDE
Download:

http://www.solidfiles.com/d/879d1213462fc1562d16d464e90c8cf9/
Naslov: Odg: chat
Poruka od: Joey_ poslato Mart 03, 2013, 20:21:21 POSLE PODNE
Otvori temu po pravilima. Lock.

A ti Flash bi trebao znati pravila.