[POMOC]Strcmp

Započeo [BT:RP] Mayor !, Maj 23, 2012, 13:20:03 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 4 gostiju pregledaju ovu temu.

[BT:RP] Mayor !

Ime skripte:Moj gm od 0
Problem:E ovako kako da napravim da mogu ubaciti i ZCMD I STRCMP znaci meni sada moze ZCMD,al ne moze STRCMP mod samo prihvata ZCMD a strcmp erore baca kada bilo koju komandu upisem pa bih voleo da mi pomognete kako da napravim da mogu staviti STRCMP komande.
Dio Skripte:eo sta imam pod #include


#include <a_samp>
#include <YSI\y_ini>
#include <zcmd>
#include <sscanf2>
#include <streamer>
Poslednja Izmena: Maj 23, 2012, 13:20:56 POSLE PODNE od Satake

Vidi ovako, strcmp komande moras obavezno stavljat pod
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/tvoja strcmp komanda", cmdtext, true, 10) == 0)
{
// Tu sad napises :D
return 1;
}
return 0;
}


A zcmd mos izvan nekog publica odnosno na kraj gamemoda je najbolje ;)
Since 19.6.2011 - P!xel
                                  

- Skripter
- Maper
- Web Developer


[BT:RP] Mayor !

Citat: P!xel poslato Maj 23, 2012, 13:31:55 POSLE PODNE
Vidi ovako, strcmp komande moras obavezno stavljat pod
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/tvoja strcmp komanda", cmdtext, true, 10) == 0)
{
// Tu sad napises :D
return 1;
}
return 0;
}

Sve ZCMD komande sam stavio na kraj to znam al nisam neki pro sto se tice ZCMD nego STRCMP tkao da sad cu probat pa cu videti.Hvala u svakom slucaju nemojte LOCK !
A zcmd mos izvan nekog publica odnosno na kraj gamemoda je najbolje ;)

Citat: P!xel poslato Maj 23, 2012, 13:31:55 POSLE PODNE
Vidi ovako, strcmp komande moras obavezno stavljat pod
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/tvoja strcmp komanda", cmdtext, true, 10) == 0)
{
// Tu sad napises :D
return 1;
}
return 0;
}


A zcmd mos izvan nekog publica odnosno na kraj gamemoda je najbolje ;)
Ma ti nisi vidio pawna svojim ocima


Brate samo za tebe
napravi ovaj pulic

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
   if(success) return 1;
   else return OnPlayerStrcmpCommand(playerid, cmdtext);
}

Onda zamjeni ime publica onplayercommandtext sa ovim
public OnPlayerStrcmpCommand(playerid, cmdtext[])
naravno trebas i forwardovati publice :D


[BT:RP] Mayor !

Nece errore opet baca



Sad cu videti mexo

[BT:RP] Mayor !

Citat: [RG] mexo poslato Maj 23, 2012, 13:38:58 POSLE PODNE
Citat: P!xel poslato Maj 23, 2012, 13:31:55 POSLE PODNE
Vidi ovako, strcmp komande moras obavezno stavljat pod
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/tvoja strcmp komanda", cmdtext, true, 10) == 0)
{
// Tu sad napises :D
return 1;
}
return 0;
}


A zcmd mos izvan nekog publica odnosno na kraj gamemoda je najbolje ;)
Ma ti nisi vidio pawna svojim ocima


Brate samo za tebe
napravi ovaj pulic

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
   if(success) return 1;
   else return OnPlayerStrcmpCommand(playerid, cmdtext);
}

Onda zamjeni ime publica onplayercommandtext sa ovim
public OnPlayerStrcmpCommand(playerid, cmdtext[])
naravno trebas i forwardovati publice :D
ovako ne radi mi uopste sada slusaj uopste nemam OnPlayerCommandText
i kad kucam ovo sto si dao ovo baci

//----
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
   if(success) return 1;
   else return OnPlayerStrcmpCommand(playerid, cmdtext);
}
public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
)
public OnPlayerStrcmpCommand(playerid, cmdtext[])

to je komanda a baci mi
C:\Documents and Settings\Marko\Desktop\Dillmore_RP\Dillmore_RP\Dillmore RP\gamemodes\dl-rp.pwn(205) : error 017: undefined symbol "OnPlayerStrcmpCommand"
C:\Documents and Settings\Marko\Desktop\Dillmore_RP\Dillmore_RP\Dillmore RP\gamemodes\dl-rp.pwn(209) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Marko\Desktop\Dillmore_RP\Dillmore_RP\Dillmore RP\gamemodes\dl-rp.pwn(210) : warning 217: loose indentation
C:\Documents and Settings\Marko\Desktop\Dillmore_RP\Dillmore_RP\Dillmore RP\gamemodes\dl-rp.pwn(210) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Marko\Desktop\Dillmore_RP\Dillmore_RP\Dillmore RP\gamemodes\dl-rp.pwn(210 -- 211) : warning 215: expression has no effect
C:\Documents and Settings\Marko\Desktop\Dillmore_RP\Dillmore_RP\Dillmore RP\gamemodes\dl-rp.pwn(211) : error 001: expected token: ";", but found "public"
C:\Documents and Settings\Marko\Desktop\Dillmore_RP\Dillmore_RP\Dillmore RP\gamemodes\dl-rp.pwn(211) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Marko\Desktop\Dillmore_RP\Dillmore_RP\Dillmore RP\gamemodes\dl-rp.pwn(211) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


6 Errors.

haj mi daj linije od 205 do 211


Citat: [RG] mexo poslato Maj 23, 2012, 13:38:58 POSLE PODNE
Citat: P!xel poslato Maj 23, 2012, 13:31:55 POSLE PODNE
Vidi ovako, strcmp komande moras obavezno stavljat pod
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/tvoja strcmp komanda", cmdtext, true, 10) == 0)
{
// Tu sad napises :D
return 1;
}
return 0;
}


A zcmd mos izvan nekog publica odnosno na kraj gamemoda je najbolje ;)
Ma ti nisi vidio pawna svojim ocima


Brate samo za tebe
napravi ovaj pulic

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
   if(success) return 1;
   else return OnPlayerStrcmpCommand(playerid, cmdtext);
}

Onda zamjeni ime publica onplayercommandtext sa ovim
public OnPlayerStrcmpCommand(playerid, cmdtext[])
naravno trebas i forwardovati publice :D

Kaj ti motas? :O
Gle vidi sam trebas u public public OnPlayerCommandText(playerid, cmdtext[])
ubaciti koju komandu zelis PRIMJER:

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/heal", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid,100);
                SendClientMessage(playerid,-1,"Postavili ste svoje zdravlje na 100);
return 1;
} // SAD AKO ZELIS DRUGU KOMANDU SAMO ISPOD

if (strcmp("/pravila", cmdtext, true, 10) == 0)
{
                SendClientMessage(playerid,-1,"RP - Bla bla itd...);
return 1;
}

return 0;
}


I jel to tako tesko? :O


Poslednja Izmena: Maj 23, 2012, 14:17:01 POSLE PODNE od P!xel
Since 19.6.2011 - P!xel
                                  

- Skripter
- Maper
- Web Developer


P!xel ti si pr0 skripter samo nemoj spamti covjek je skontao da to tvoje nema veze sa nicim lik hoce da koristi zcmd i Strcmp u isto vrijeme a ne samo Strcmp -.-


[BT:RP] Mayor !

/* Dillmore Roleplay
Base Roleplay script by Satake
Ukoliko pronaðete bug javite meni na PM.
Ova skripta æe biti updateovana s vremena na vrijeme.
Ukoliko imate prijedloga za skriptu javite meni na PM.
Verzija 0.1

Changelog:
Register/login system [21.5.2011]
Osnovne RP komande [21.5.2011]
*/

#include <a_samp>
#include <YSI\y_ini>
#include <zcmd>
#include <sscanf2>
#include <streamer>

#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2

#define PATH "/Users/%s.ini"

#define COL_WHITE "{FFFFFF}"
#define COL_RED "{F81414}"
#define COL_GREEN "{00FF22}"
#define COL_LIGHTBLUE "{00CED1}"
#define COLOR_FADE1 0xE6E6E6E6
#define COLOR_FADE2 0xC8C8C8C8
#define COLOR_FADE3 0xAAAAAAAA
#define COLOR_FADE4 0x8C8C8C8C
#define COLOR_FADE5 0x6E6E6E6E
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_SYNTAX        0x33CCFFAA

#define SCM SendClientMessage
/* new */
forward RandomMessage();
new RandomMessages[][] =
{
    "UnderWorld: ~w~Posetite nas forum www.~r~uw-rp~w~.com i registrujte se.",
    "UnderWorld: ~w~Ukoliko vidite ~y~citera ~w~ili primetite ~y~bug ~w~prijavite na ~r~/report.",
    "UnderWorld: ~w~Ukoliko ste novi igrac i ako vam treba pomoc kucajte ~r~/new ~w~ili ~r~/pomoc.",
    "UnderWorld: ~w~Za ulazak u organizaciju potreban vam je ~R~Level 2.",
    "UnderWorld: ~w~Da vidite listu online admina i gamemastera ~r~/admini~w~,~r~/gamemasteri~w~.",
    "UnderWorld: ~w~Lokacije poslova mozete videti u opstini na salteru komandom ~r~/poslovi ~w~!",
    "UnderWorld: ~w~Neznate Pravila? Kucajte ~r~/pravila ~w~i procitajte pravila servera.",
    "UnderWorld: ~w~Sve komande mozete pronaci na ~b~/help ~w~ili ~r~/komande."

};
new Poslovice[][] =
{
//   Poslovice
    "{0F629F}* Izreka dana  Ako mi ne mozes pomoci, nemoj mi odmagati.",
    "{0F629F}* Izreka dana  Ko laze za tebe, lagace i protiv tebe.",
"{0F629F}* Izreka dana  Bolje je pokliznuti nogom nego jezikom.",
"{0F629F}* Izreka dana  Ako znas sta je bilo, ne znas sta ce biti.",
"{0F629F}* Izreka dana  Ako kupujes cesto ono sto ti ne treba, skoro ces prodavati ono sto ti treba.",
"{0F629F}* Izreka dana  Ko rano rani dvije srece grabi.",
"{0F629F}* Izreka dana  Um caruje, snaga klade valja.",
    "{0F629F}* Izreka dana  Gvozdje reze i drvo i kamen, ali i njega rdja jede.",
"{0F629F}* Izreka dana  Kuca nije tijesna kad celjad nije bijesna.",
"{0F629F}* Izreka dana  Poklonu se u zube ne gleda.",
    "{0F629F}* Izreka dana  Sit gladnom ne vjeruje.",
    "{0F629F}* Izreka dana U lazi su kratke noge.",
    "{0F629F}* Izreka dana  Istina i zena najljepse su gole.",
    "{0F629F}* Izreka dana  Istina uvijek najvise boli.",
    "{0F629F}* Izreka dana  Jeftina roba kasu prazni.",
    "{0F629F}* Izreka dana  Nije siromasan ko malo ima vec ko mnogo zeli.",
    "{0F629F}* Izreka dana  Prijatelj se u nevolji poznaje ko zlato u vatri.",
    "{0F629F}* Izreka dana  Svaka ptica svome jatu leti."

};
new BigEar[MAX_PLAYERS];

enum pInfo
{
    pPass,
    pNovac,
    pAdmin,
    pGodine,
    pZemlja
}
new PlayerInfo[MAX_PLAYERS][pInfo];

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][pPass]);
    INI_Int("Novac",PlayerInfo[playerid][pNovac]);
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    INI_Int("Godine",PlayerInfo[playerid][pGodine]);
    INI_Int("Zemlja",PlayerInfo[playerid][pZemlja]);
    return 1;
}

stock UserPath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),PATH,playername);
    return string;
}

/*Credits to Dracoblue*/
stock udb_hash(buf[]) {
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}

main()
{
print("\n----------------------------------");
print(" Dillmore Roleplay           ");
print(" By Satake, v0.1           ");
print("----------------------------------\n");
}

public OnGameModeInit()
{
SetGameModeText("Roleplay");
/* Mape*/
//Spawn
CreateDynamicObject(997, 667.20001220703, -475, 15.300000190735, 0, 0, 0);
CreateDynamicObject(997, 658.40002441406, -475, 15.300000190735, 0, 0, 0);
CreateDynamicObject(997, 692.59997558594, -475, 15.300000190735, 0, 0, 0);
CreateDynamicObject(997, 708.09997558594, -475, 15.300000190735, 0, 0, 0);
CreateDynamicObject(997, 651.79998779297, -463.89999389648, 15.300000190735, 0, 0, 270);
CreateDynamicObject(997, 651.79998779297, -460.79998779297, 15.300000190735, 0, 0, 270);
CreateDynamicObject(997, 651.79998779297, -437.89999389648, 15.300000190735, 0, 0, 270);
CreateDynamicObject(997, 651.79998779297, -444.20001220703, 15.300000190735, 0, 0, 90);
CreateDynamicObject(792, 652.5, -461.60000610352, 15.39999961853, 0, 0, 0);
CreateDynamicObject(792, 652.59997558594, -443.39999389648, 15.39999961853, 0, 0, 0);
CreateDynamicObject(792, 660.90002441406, -474.29998779297, 15.39999961853, 0, 0, 0);
CreateDynamicObject(792, 668.09997558594, -474.29998779297, 15.39999961853, 0, 0, 0);
CreateDynamicObject(792, 698, -474.20001220703, 15.39999961853, 0, 0, 0);
CreateDynamicObject(997, 698.90002441406, -475, 15.300000190735, 0, 0, 180);
CreateDynamicObject(997, 705, -475, 15.300000190735, 0, 0, 0);
CreateDynamicObject(792, 705.79998779297, -474.20001220703, 15.39999961853, 0, 0, 0);
CreateDynamicObject(1346, 652.79998779297, -466.20001220703, 16.700000762939, 0, 0, 124);
CreateDynamicObject(1359, 652.29998779297, -464.70001220703, 16, 0, 0, 0);
/* Auta */
AddStaticVehicleEx(401,667.29998779,-464.50000000,16.20000076,274.00000000,-1,-1,15); //Bravura
AddStaticVehicleEx(463,695.20001221,-463.79998779,16.00000000,76.00000000,-1,-1,15); //Freeway
AddStaticVehicleEx(549,667.79998779,-583.09997559,16.20000076,292.00000000,-1,-1,15); //Tampa
AddStaticVehicleEx(525,666.90002441,-546.50000000,16.29999924,274.00000000,-1,-1,15); //Tow Truck
AddStaticVehicleEx(599,614.90002441,-597.40002441,17.60000038,272.00000000,-1,1,15); //Police Ranger
AddStaticVehicleEx(414,797.40002441,-613.50000000,16.50000000,0.00000000,16,1,15); //Mule
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
return 1;
}

public OnPlayerConnect(playerid)
{
   if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Upisite svoj password da se ulogujete.","Login","Odustani");
    }
        else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registracija",""COL_WHITE"Upisite password da se registrujete.","Register","Odustani");
    }
   
   return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Novac",GetPlayerMoney(playerid));
    INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    INI_WriteInt(File,"Godine",PlayerInfo[playerid][pGodine]);
    INI_WriteInt(File,"Zemlja",PlayerInfo[playerid][pZemlja]);
    INI_Close(File);
    return 1;
}

public OnPlayerSpawn(playerid)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}

public OnPlayerText(playerid, text[])
{
return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}

public OnRconCommand(cmd[])
{
return 1;
}

public OnPlayerRequestSpawn(playerid)
{
return 1;
}

public OnObjectMoved(objectid)
{
return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}

public OnPlayerExitedMenu(playerid)
{
return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}

public OnPlayerUpdate(playerid)
{
return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Zemlja",0);
                INI_WriteInt(File,"Godine",0);
                INI_Close(File);
               
                SetSpawnInfo(playerid, 0, 0, 671.40002441406, -457.89999389648, 16.5, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
}
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pNovac]);
                    SetSpawnInfo(playerid, 0, 0, 671.40002441406, -457.89999389648, 16.5, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"Ukucali ste pogresan password\n"COL_WHITE"Upisite password da se ulogujete.","Login","Izlaz");
                }
                return 1;
            }
        }
    }
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}

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

stock PlayerName(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
}

/* ------------------Komande-------------------- */
/* Osnovne RP komande*/

CMD:b(playerid,params[])
{
    if(isnull(params)) return SendClientMessage(playerid, COLOR_SYNTAX,"[CMD]: /b [lokalni ooc chat]");
    new sendername[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid,sendername,sizeof(sendername));
    sendername[strfind(sendername,"_")] = ' ';
    format(string, sizeof(string), "((%s: %s ))", sendername, params);
    ProxDetector(30.0, playerid, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    return 1;
}

CMD:s(playerid,params[])
{
    if(isnull(params)) return SendClientMessage(playerid, COLOR_SYNTAX,"[CMD]: /s [glasno]");
    new sendername[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s se dere: %s!!", sendername, params);
    ProxDetector(60.0, playerid, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    return 1;
}

CMD:l(playerid,params[])
{
    if(isnull(params)) return SendClientMessage(playerid, COLOR_SYNTAX,"[CMD]:/l [tiho]");
    new sendername[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid,sendername,sizeof(sendername));
    sendername[strfind(sendername,"_")] = ' ';
    format(string,sizeof(string), "%s :[Tiho] %s", sendername, params);
    ProxDetector(3.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
    return 1;
}

CMD:me(playerid, params[])
{
    new name[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, name, sizeof(name));
    if(isnull(params))
        return SendClientMessage(playerid,COLOR_SYNTAX -1,"[CMD]: /me [akcija]");
    format(str,sizeof(str),"*%s %s",name, params);
    ProxDetector(30.0, playerid, str, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    return 1;
}

to mi je pola gmoda i nema nigde onplayercommandtext a kad napravim baca erore

Citat: [RG] mexo poslato Maj 23, 2012, 14:19:05 POSLE PODNE
P!xel ti si pr0 skripter samo nemoj spamti covjek je skontao da to tvoje nema veze sa nicim lik hoce da koristi zcmd i Strcmp u isto vrijeme a ne samo Strcmp -.-

Vidi se da si "jako" dobar skripter, svaka cast ;)

Citat: Satake poslato Maj 23, 2012, 14:21:15 POSLE PODNE
/* Dillmore Roleplay
Base Roleplay script by Satake
Ukoliko pronaðete bug javite meni na PM.
Ova skripta æe biti updateovana s vremena na vrijeme.
Ukoliko imate prijedloga za skriptu javite meni na PM.
Verzija 0.1

Changelog:
Register/login system [21.5.2011]
Osnovne RP komande [21.5.2011]
*/

#include <a_samp>
#include <YSI\y_ini>
#include <zcmd>
#include <sscanf2>
#include <streamer>

#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2

#define PATH "/Users/%s.ini"

#define COL_WHITE "{FFFFFF}"
#define COL_RED "{F81414}"
#define COL_GREEN "{00FF22}"
#define COL_LIGHTBLUE "{00CED1}"
#define COLOR_FADE1 0xE6E6E6E6
#define COLOR_FADE2 0xC8C8C8C8
#define COLOR_FADE3 0xAAAAAAAA
#define COLOR_FADE4 0x8C8C8C8C
#define COLOR_FADE5 0x6E6E6E6E
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_SYNTAX        0x33CCFFAA

#define SCM SendClientMessage
/* new */
forward RandomMessage();
new RandomMessages[][] =
{
    "UnderWorld: ~w~Posetite nas forum www.~r~uw-rp~w~.com i registrujte se.",
    "UnderWorld: ~w~Ukoliko vidite ~y~citera ~w~ili primetite ~y~bug ~w~prijavite na ~r~/report.",
    "UnderWorld: ~w~Ukoliko ste novi igrac i ako vam treba pomoc kucajte ~r~/new ~w~ili ~r~/pomoc.",
    "UnderWorld: ~w~Za ulazak u organizaciju potreban vam je ~R~Level 2.",
    "UnderWorld: ~w~Da vidite listu online admina i gamemastera ~r~/admini~w~,~r~/gamemasteri~w~.",
    "UnderWorld: ~w~Lokacije poslova mozete videti u opstini na salteru komandom ~r~/poslovi ~w~!",
    "UnderWorld: ~w~Neznate Pravila? Kucajte ~r~/pravila ~w~i procitajte pravila servera.",
    "UnderWorld: ~w~Sve komande mozete pronaci na ~b~/help ~w~ili ~r~/komande."

};
new Poslovice[][] =
{
//   Poslovice
    "{0F629F}* Izreka dana  Ako mi ne mozes pomoci, nemoj mi odmagati.",
    "{0F629F}* Izreka dana  Ko laze za tebe, lagace i protiv tebe.",
"{0F629F}* Izreka dana  Bolje je pokliznuti nogom nego jezikom.",
"{0F629F}* Izreka dana  Ako znas sta je bilo, ne znas sta ce biti.",
"{0F629F}* Izreka dana  Ako kupujes cesto ono sto ti ne treba, skoro ces prodavati ono sto ti treba.",
"{0F629F}* Izreka dana  Ko rano rani dvije srece grabi.",
"{0F629F}* Izreka dana  Um caruje, snaga klade valja.",
    "{0F629F}* Izreka dana  Gvozdje reze i drvo i kamen, ali i njega rdja jede.",
"{0F629F}* Izreka dana  Kuca nije tijesna kad celjad nije bijesna.",
"{0F629F}* Izreka dana  Poklonu se u zube ne gleda.",
    "{0F629F}* Izreka dana  Sit gladnom ne vjeruje.",
    "{0F629F}* Izreka dana U lazi su kratke noge.",
    "{0F629F}* Izreka dana  Istina i zena najljepse su gole.",
    "{0F629F}* Izreka dana  Istina uvijek najvise boli.",
    "{0F629F}* Izreka dana  Jeftina roba kasu prazni.",
    "{0F629F}* Izreka dana  Nije siromasan ko malo ima vec ko mnogo zeli.",
    "{0F629F}* Izreka dana  Prijatelj se u nevolji poznaje ko zlato u vatri.",
    "{0F629F}* Izreka dana  Svaka ptica svome jatu leti."

};
new BigEar[MAX_PLAYERS];

enum pInfo
{
    pPass,
    pNovac,
    pAdmin,
    pGodine,
    pZemlja
}
new PlayerInfo[MAX_PLAYERS][pInfo];

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][pPass]);
    INI_Int("Novac",PlayerInfo[playerid][pNovac]);
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    INI_Int("Godine",PlayerInfo[playerid][pGodine]);
    INI_Int("Zemlja",PlayerInfo[playerid][pZemlja]);
    return 1;
}

stock UserPath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),PATH,playername);
    return string;
}

/*Credits to Dracoblue*/
stock udb_hash(buf[]) {
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}

main()
{
print("\n----------------------------------");
print(" Dillmore Roleplay           ");
print(" By Satake, v0.1           ");
print("----------------------------------\n");
}

public OnGameModeInit()
{
SetGameModeText("Roleplay");
/* Mape*/
//Spawn
CreateDynamicObject(997, 667.20001220703, -475, 15.300000190735, 0, 0, 0);
CreateDynamicObject(997, 658.40002441406, -475, 15.300000190735, 0, 0, 0);
CreateDynamicObject(997, 692.59997558594, -475, 15.300000190735, 0, 0, 0);
CreateDynamicObject(997, 708.09997558594, -475, 15.300000190735, 0, 0, 0);
CreateDynamicObject(997, 651.79998779297, -463.89999389648, 15.300000190735, 0, 0, 270);
CreateDynamicObject(997, 651.79998779297, -460.79998779297, 15.300000190735, 0, 0, 270);
CreateDynamicObject(997, 651.79998779297, -437.89999389648, 15.300000190735, 0, 0, 270);
CreateDynamicObject(997, 651.79998779297, -444.20001220703, 15.300000190735, 0, 0, 90);
CreateDynamicObject(792, 652.5, -461.60000610352, 15.39999961853, 0, 0, 0);
CreateDynamicObject(792, 652.59997558594, -443.39999389648, 15.39999961853, 0, 0, 0);
CreateDynamicObject(792, 660.90002441406, -474.29998779297, 15.39999961853, 0, 0, 0);
CreateDynamicObject(792, 668.09997558594, -474.29998779297, 15.39999961853, 0, 0, 0);
CreateDynamicObject(792, 698, -474.20001220703, 15.39999961853, 0, 0, 0);
CreateDynamicObject(997, 698.90002441406, -475, 15.300000190735, 0, 0, 180);
CreateDynamicObject(997, 705, -475, 15.300000190735, 0, 0, 0);
CreateDynamicObject(792, 705.79998779297, -474.20001220703, 15.39999961853, 0, 0, 0);
CreateDynamicObject(1346, 652.79998779297, -466.20001220703, 16.700000762939, 0, 0, 124);
CreateDynamicObject(1359, 652.29998779297, -464.70001220703, 16, 0, 0, 0);
/* Auta */
AddStaticVehicleEx(401,667.29998779,-464.50000000,16.20000076,274.00000000,-1,-1,15); //Bravura
AddStaticVehicleEx(463,695.20001221,-463.79998779,16.00000000,76.00000000,-1,-1,15); //Freeway
AddStaticVehicleEx(549,667.79998779,-583.09997559,16.20000076,292.00000000,-1,-1,15); //Tampa
AddStaticVehicleEx(525,666.90002441,-546.50000000,16.29999924,274.00000000,-1,-1,15); //Tow Truck
AddStaticVehicleEx(599,614.90002441,-597.40002441,17.60000038,272.00000000,-1,1,15); //Police Ranger
AddStaticVehicleEx(414,797.40002441,-613.50000000,16.50000000,0.00000000,16,1,15); //Mule
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
return 1;
}

public OnPlayerConnect(playerid)
{
   if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Upisite svoj password da se ulogujete.","Login","Odustani");
    }
        else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registracija",""COL_WHITE"Upisite password da se registrujete.","Register","Odustani");
    }
   
   return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Novac",GetPlayerMoney(playerid));
    INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    INI_WriteInt(File,"Godine",PlayerInfo[playerid][pGodine]);
    INI_WriteInt(File,"Zemlja",PlayerInfo[playerid][pZemlja]);
    INI_Close(File);
    return 1;
}

public OnPlayerSpawn(playerid)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}

public OnPlayerText(playerid, text[])
{
return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}

public OnRconCommand(cmd[])
{
return 1;
}

public OnPlayerRequestSpawn(playerid)
{
return 1;
}

public OnObjectMoved(objectid)
{
return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}

public OnPlayerExitedMenu(playerid)
{
return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}

public OnPlayerUpdate(playerid)
{
return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Zemlja",0);
                INI_WriteInt(File,"Godine",0);
                INI_Close(File);
               
                SetSpawnInfo(playerid, 0, 0, 671.40002441406, -457.89999389648, 16.5, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
}
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pNovac]);
                    SetSpawnInfo(playerid, 0, 0, 671.40002441406, -457.89999389648, 16.5, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"Ukucali ste pogresan password\n"COL_WHITE"Upisite password da se ulogujete.","Login","Izlaz");
                }
                return 1;
            }
        }
    }
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}

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

stock PlayerName(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
}

/* ------------------Komande-------------------- */
/* Osnovne RP komande*/

CMD:b(playerid,params[])
{
    if(isnull(params)) return SendClientMessage(playerid, COLOR_SYNTAX,"[CMD]: /b [lokalni ooc chat]");
    new sendername[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid,sendername,sizeof(sendername));
    sendername[strfind(sendername,"_")] = ' ';
    format(string, sizeof(string), "((%s: %s ))", sendername, params);
    ProxDetector(30.0, playerid, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    return 1;
}

CMD:s(playerid,params[])
{
    if(isnull(params)) return SendClientMessage(playerid, COLOR_SYNTAX,"[CMD]: /s [glasno]");
    new sendername[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s se dere: %s!!", sendername, params);
    ProxDetector(60.0, playerid, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    return 1;
}

CMD:l(playerid,params[])
{
    if(isnull(params)) return SendClientMessage(playerid, COLOR_SYNTAX,"[CMD]:/l [tiho]");
    new sendername[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid,sendername,sizeof(sendername));
    sendername[strfind(sendername,"_")] = ' ';
    format(string,sizeof(string), "%s :[Tiho] %s", sendername, params);
    ProxDetector(3.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
    return 1;
}

CMD:me(playerid, params[])
{
    new name[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, name, sizeof(name));
    if(isnull(params))
        return SendClientMessage(playerid,COLOR_SYNTAX -1,"[CMD]: /me [akcija]");
    format(str,sizeof(str),"*%s %s",name, params);
    ProxDetector(30.0, playerid, str, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    return 1;
}

to mi je pola gmoda i nema nigde onplayercommandtext a kad napravim baca erore

Ovako, da bi koristio i zcmd i strcmp moras napraviti public OnPlayerCommandText(playerid, cmdtext[]) ( naravno ako toga nema, ako ima onda strcmp komande ubacujes ispod toga), a sto se tice zcmd-a one komande mozes ostaviti kako i jesu, al ak os bas nekoje sa zcmd-om radit onda samo radi ispod oni ostalih zcmd komandi. ** Al kazem ti strcmp komande obavezno ubacuj ispod public OnPlayerCommandText(playerid, cmdtext[]) , nadam se da si sad svatio ;)



EDIT: (evo ti sad gm da mozes koristiti u strcmp samo vidis di su komande pod  public OnPlayerCommandText(playerid, cmdtext[]) e tu sam ti napravio osnovne neke ti samo radi sad ispod dalje tak komande ;)
/* Dillmore Roleplay
Base Roleplay script by Satake
Ukoliko pronaðete bug javite meni na PM.
Ova skripta æe biti updateovana s vremena na vrijeme.
Ukoliko imate prijedloga za skriptu javite meni na PM.
Verzija 0.1

Changelog:
Register/login system [21.5.2011]
Osnovne RP komande [21.5.2011]
*/

#include <a_samp>
#include <YSI\y_ini>
#include <zcmd>
#include <sscanf2>
#include <streamer>

#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2

#define PATH "/Users/%s.ini"

#define COL_WHITE "{FFFFFF}"
#define COL_RED "{F81414}"
#define COL_GREEN "{00FF22}"
#define COL_LIGHTBLUE "{00CED1}"
#define COLOR_FADE1 0xE6E6E6E6
#define COLOR_FADE2 0xC8C8C8C8
#define COLOR_FADE3 0xAAAAAAAA
#define COLOR_FADE4 0x8C8C8C8C
#define COLOR_FADE5 0x6E6E6E6E
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_SYNTAX        0x33CCFFAA

#define SCM SendClientMessage
/* new */
forward RandomMessage();
new RandomMessages[][] =
{
    "UnderWorld: ~w~Posetite nas forum www.~r~uw-rp~w~.com i registrujte se.",
    "UnderWorld: ~w~Ukoliko vidite ~y~citera ~w~ili primetite ~y~bug ~w~prijavite na ~r~/report.",
    "UnderWorld: ~w~Ukoliko ste novi igrac i ako vam treba pomoc kucajte ~r~/new ~w~ili ~r~/pomoc.",
    "UnderWorld: ~w~Za ulazak u organizaciju potreban vam je ~R~Level 2.",
    "UnderWorld: ~w~Da vidite listu online admina i gamemastera ~r~/admini~w~,~r~/gamemasteri~w~.",
    "UnderWorld: ~w~Lokacije poslova mozete videti u opstini na salteru komandom ~r~/poslovi ~w~!",
    "UnderWorld: ~w~Neznate Pravila? Kucajte ~r~/pravila ~w~i procitajte pravila servera.",
    "UnderWorld: ~w~Sve komande mozete pronaci na ~b~/help ~w~ili ~r~/komande."

};
new Poslovice[][] =
{
//   Poslovice
    "{0F629F}* Izreka dana  Ako mi ne mozes pomoci, nemoj mi odmagati.",
    "{0F629F}* Izreka dana  Ko laze za tebe, lagace i protiv tebe.",
"{0F629F}* Izreka dana  Bolje je pokliznuti nogom nego jezikom.",
"{0F629F}* Izreka dana  Ako znas sta je bilo, ne znas sta ce biti.",
"{0F629F}* Izreka dana  Ako kupujes cesto ono sto ti ne treba, skoro ces prodavati ono sto ti treba.",
"{0F629F}* Izreka dana  Ko rano rani dvije srece grabi.",
"{0F629F}* Izreka dana  Um caruje, snaga klade valja.",
    "{0F629F}* Izreka dana  Gvozdje reze i drvo i kamen, ali i njega rdja jede.",
"{0F629F}* Izreka dana  Kuca nije tijesna kad celjad nije bijesna.",
"{0F629F}* Izreka dana  Poklonu se u zube ne gleda.",
    "{0F629F}* Izreka dana  Sit gladnom ne vjeruje.",
    "{0F629F}* Izreka dana U lazi su kratke noge.",
    "{0F629F}* Izreka dana  Istina i zena najljepse su gole.",
    "{0F629F}* Izreka dana  Istina uvijek najvise boli.",
    "{0F629F}* Izreka dana  Jeftina roba kasu prazni.",
    "{0F629F}* Izreka dana  Nije siromasan ko malo ima vec ko mnogo zeli.",
    "{0F629F}* Izreka dana  Prijatelj se u nevolji poznaje ko zlato u vatri.",
    "{0F629F}* Izreka dana  Svaka ptica svome jatu leti."

};
new BigEar[MAX_PLAYERS];

enum pInfo
{
    pPass,
    pNovac,
    pAdmin,
    pGodine,
    pZemlja
}
new PlayerInfo[MAX_PLAYERS][pInfo];

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][pPass]);
    INI_Int("Novac",PlayerInfo[playerid][pNovac]);
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    INI_Int("Godine",PlayerInfo[playerid][pGodine]);
    INI_Int("Zemlja",PlayerInfo[playerid][pZemlja]);
    return 1;
}

stock UserPath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),PATH,playername);
    return string;
}

/*Credits to Dracoblue*/
stock udb_hash(buf[]) {
    new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}

main()
{
print("\n----------------------------------");
print(" Dillmore Roleplay           ");
print(" By Satake, v0.1           ");
print("----------------------------------\n");
}

public OnGameModeInit()
{
SetGameModeText("Roleplay");
/* Mape*/
//Spawn
CreateDynamicObject(997, 667.20001220703, -475, 15.300000190735, 0, 0, 0);
CreateDynamicObject(997, 658.40002441406, -475, 15.300000190735, 0, 0, 0);
CreateDynamicObject(997, 692.59997558594, -475, 15.300000190735, 0, 0, 0);
CreateDynamicObject(997, 708.09997558594, -475, 15.300000190735, 0, 0, 0);
CreateDynamicObject(997, 651.79998779297, -463.89999389648, 15.300000190735, 0, 0, 270);
CreateDynamicObject(997, 651.79998779297, -460.79998779297, 15.300000190735, 0, 0, 270);
CreateDynamicObject(997, 651.79998779297, -437.89999389648, 15.300000190735, 0, 0, 270);
CreateDynamicObject(997, 651.79998779297, -444.20001220703, 15.300000190735, 0, 0, 90);
CreateDynamicObject(792, 652.5, -461.60000610352, 15.39999961853, 0, 0, 0);
CreateDynamicObject(792, 652.59997558594, -443.39999389648, 15.39999961853, 0, 0, 0);
CreateDynamicObject(792, 660.90002441406, -474.29998779297, 15.39999961853, 0, 0, 0);
CreateDynamicObject(792, 668.09997558594, -474.29998779297, 15.39999961853, 0, 0, 0);
CreateDynamicObject(792, 698, -474.20001220703, 15.39999961853, 0, 0, 0);
CreateDynamicObject(997, 698.90002441406, -475, 15.300000190735, 0, 0, 180);
CreateDynamicObject(997, 705, -475, 15.300000190735, 0, 0, 0);
CreateDynamicObject(792, 705.79998779297, -474.20001220703, 15.39999961853, 0, 0, 0);
CreateDynamicObject(1346, 652.79998779297, -466.20001220703, 16.700000762939, 0, 0, 124);
CreateDynamicObject(1359, 652.29998779297, -464.70001220703, 16, 0, 0, 0);
/* Auta */
AddStaticVehicleEx(401,667.29998779,-464.50000000,16.20000076,274.00000000,-1,-1,15); //Bravura
AddStaticVehicleEx(463,695.20001221,-463.79998779,16.00000000,76.00000000,-1,-1,15); //Freeway
AddStaticVehicleEx(549,667.79998779,-583.09997559,16.20000076,292.00000000,-1,-1,15); //Tampa
AddStaticVehicleEx(525,666.90002441,-546.50000000,16.29999924,274.00000000,-1,-1,15); //Tow Truck
AddStaticVehicleEx(599,614.90002441,-597.40002441,17.60000038,272.00000000,-1,1,15); //Police Ranger
AddStaticVehicleEx(414,797.40002441,-613.50000000,16.50000000,0.00000000,16,1,15); //Mule
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
return 1;
}

public OnPlayerConnect(playerid)
{
   if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Upisite svoj password da se ulogujete.","Login","Odustani");
    }
        else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registracija",""COL_WHITE"Upisite password da se registrujete.","Register","Odustani");
    }
   
   return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Novac",GetPlayerMoney(playerid));
    INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    INI_WriteInt(File,"Godine",PlayerInfo[playerid][pGodine]);
    INI_WriteInt(File,"Zemlja",PlayerInfo[playerid][pZemlja]);
    INI_Close(File);
    return 1;
}

public OnPlayerSpawn(playerid)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}

public OnPlayerText(playerid, text[])
{
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/heal", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid,100);
                SendClientMessage(playerid,-1,"Postavili ste svoje zdravlje na 100);
return 1;
} // SAD AKO ZELIS DRUGU KOMANDU SAMO ISPOD

if (strcmp("/pravila", cmdtext, true, 10) == 0)
{
                SendClientMessage(playerid,-1,"RP - Bla bla itd...);
return 1;
}

return 0;
}


public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}

public OnRconCommand(cmd[])
{
return 1;
}

public OnPlayerRequestSpawn(playerid)
{
return 1;
}

public OnObjectMoved(objectid)
{
return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}

public OnPlayerExitedMenu(playerid)
{
return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}

public OnPlayerUpdate(playerid)
{
return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Zemlja",0);
                INI_WriteInt(File,"Godine",0);
                INI_Close(File);
               
                SetSpawnInfo(playerid, 0, 0, 671.40002441406, -457.89999389648, 16.5, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
}
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pNovac]);
                    SetSpawnInfo(playerid, 0, 0, 671.40002441406, -457.89999389648, 16.5, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"Ukucali ste pogresan password\n"COL_WHITE"Upisite password da se ulogujete.","Login","Izlaz");
                }
                return 1;
            }
        }
    }
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}

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

stock PlayerName(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
}

/* ------------------Komande-------------------- */
/* Osnovne RP komande*/

CMD:b(playerid,params[])
{
    if(isnull(params)) return SendClientMessage(playerid, COLOR_SYNTAX,"[CMD]: /b [lokalni ooc chat]");
    new sendername[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid,sendername,sizeof(sendername));
    sendername[strfind(sendername,"_")] = ' ';
    format(string, sizeof(string), "((%s: %s ))", sendername, params);
    ProxDetector(30.0, playerid, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    return 1;
}

CMD:s(playerid,params[])
{
    if(isnull(params)) return SendClientMessage(playerid, COLOR_SYNTAX,"[CMD]: /s [glasno]");
    new sendername[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "%s se dere: %s!!", sendername, params);
    ProxDetector(60.0, playerid, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    return 1;
}

CMD:l(playerid,params[])
{
    if(isnull(params)) return SendClientMessage(playerid, COLOR_SYNTAX,"[CMD]:/l [tiho]");
    new sendername[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid,sendername,sizeof(sendername));
    sendername[strfind(sendername,"_")] = ' ';
    format(string,sizeof(string), "%s :[Tiho] %s", sendername, params);
    ProxDetector(3.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
    return 1;
}

CMD:me(playerid, params[])
{
    new name[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, name, sizeof(name));
    if(isnull(params))
        return SendClientMessage(playerid,COLOR_SYNTAX -1,"[CMD]: /me [akcija]");
    format(str,sizeof(str),"*%s %s",name, params);
    ProxDetector(30.0, playerid, str, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    return 1;
}
Poslednja Izmena: Maj 23, 2012, 14:30:20 POSLE PODNE od P!xel
Since 19.6.2011 - P!xel
                                  

- Skripter
- Maper
- Web Developer


[BT:RP] Mayor !


[BT:RP] Mayor !


Citat: [RG] mexo poslato Maj 23, 2012, 13:38:58 POSLE PODNE

Brate samo za tebe
napravi ovaj pulic

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
   if(success) return 1;
   else return OnPlayerStrcmpCommand(playerid, cmdtext);
}

Onda zamjeni ime publica onplayercommandtext sa ovim
public OnPlayerStrcmpCommand(playerid, cmdtext[])
naravno trebas i forwardovati publice :D
POGLEDAJ OVO -.- Fino pogledaj sta pise i tako ubaci


[BT:RP] Mayor !

Citat: [RG] mexo poslato Maj 23, 2012, 16:15:48 POSLE PODNE
Citat: [RG] mexo poslato Maj 23, 2012, 13:38:58 POSLE PODNE

Brate samo za tebe
napravi ovaj pulic

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
   if(success) return 1;
   else return OnPlayerStrcmpCommand(playerid, cmdtext);
}

Onda zamjeni ime publica onplayercommandtext sa ovim
public OnPlayerStrcmpCommand(playerid, cmdtext[])
naravno trebas i forwardovati publice :D
POGLEDAJ OVO -.- Fino pogledaj sta pise i tako ubaci
omg ti glup?
pa kako ne shvatas da NEMAM NIGDE ONPLAYERCOMMANDTEXT A KAD NAPRAVIM ERRORE BACA !