PDA

View Full Version : /RoadBlock


Dusan01
01/09/2011, 07:17 PM
When i Want to complite the filterscript than my pawno stop working. Why??

#include <a_samp>

#define FILTERSCRIPT

forward CommandLog(string[]);
public CommandLog(string[])
}

if(strcmp(cmd, "/block", true) == 0 || strcmp(cmd, "/blokada", true) == 0)


{
if(IsPlayerConnected(playerid) && IsACop(playerid) || IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "KORISTI: /blokada [Broj blokade]");
SendClientMessage(playerid, SVETLOPLAVA, "Available Roadblocks:");
SendClientMessage(playerid, COLOR_GRAD1, "| 1: Mala blokada | 2: Srednja blokada |");
SendClientMessage(playerid, COLOR_GRAD1, "| 3: Velika blodaka | 4: Cone | 5: Detour Sign |");
SendClientMessage(playerid, COLOR_GRAD1, "| 6: Will Be Sign | 7: Line Closed Sign |");
return 1;
}
new rb = strval(tmp);
if (rb == 1)
{
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
GetPlayerPos(playerid, plocx, plocy, plocz);
GetPlayerFacingAngle(playerid,ploca);
KreirajBlokadu(1459,plocx,plocy,plocz,ploca);
format(string,sizeof(string),"[HQ]: Casnik %s je postavio blokadu(1) na ovoj poziciji, prijam.",sendername);
SendRadioMessage(1,SVETLOPLAVA,string);
GameTextForPlayer(playerid,"~w~Blokada ~b~Postavljena!",3000,1);
return 1;
}
else if (rb == 2)
{
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
GetPlayerPos(playerid, plocx, plocy, plocz);
GetPlayerFacingAngle(playerid,ploca);
KreirajBlokadu(978,plocx,plocy,plocz+0.6,ploca);
format(string,sizeof(string),"[HQ]: Casnik %s je postavio blokadu(2) na ovoj poziciji, prijam.",sendername);
SendRadioMessage(1,SVETLOPLAVA,string);
GameTextForPlayer(playerid,"~w~Blokada ~b~Postavljena!",3000,1);
return 1;
}
else if (rb == 3)
{
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
GetPlayerPos(playerid, plocx, plocy, plocz);
GetPlayerFacingAngle(playerid,ploca);
KreirajBlokadu(981,plocx,plocy,plocz+0.9,ploca+180 );
format(string,sizeof(string),"[HQ]: Casnik %s je postavio blokadu(3) na ovoj poziciji, prijam.",sendername);
SendRadioMessage(1,SVETLOPLAVA,string);
GameTextForPlayer(playerid,"~w~Blokada ~g~Postavljena!",3000,1);
SetPlayerPos(playerid, plocx, plocy+1.3, plocz);
return 1;
}
else if (rb == 4)
{
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
GetPlayerPos(playerid, plocx, plocy, plocz);
GetPlayerFacingAngle(playerid,ploca);
KreirajBlokadu(1238,plocx,plocy,plocz+0.2,ploca);
format(string,sizeof(string),"[HQ]: Casnik %s je postavio Traffic Cone(1) na ovoj poziciji, prijam.",sendername);
SendRadioMessage(1,SVETLOPLAVA,string);
GameTextForPlayer(playerid,"~w~Cone ~g~Postavljena!",3000,1);
return 1;
}
else if (rb == 5)
{
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
GetPlayerPos(playerid, plocx, plocy, plocz);
GetPlayerFacingAngle(playerid,ploca);
KreirajBlokadu(1425,plocx,plocy,plocz+0.6,ploca);
format(string,sizeof(string),"[HQ]: Casnik %s je postavio Detour Sign(4) na ovoj poziciji, prijam.",sendername);
SendRadioMessage(1,SVETLOPLAVA,string);
GameTextForPlayer(playerid,"~w~Sign ~g~Postavljena!",3000,1);
return 1;
}
else if (rb == 6)
{
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
GetPlayerPos(playerid, plocx, plocy, plocz);
GetPlayerFacingAngle(playerid,ploca);
KreirajBlokadu(3265,plocx,plocy,plocz-0.5,ploca);
format(string,sizeof(string),"[HQ]: Casnik %s je postavio Will Be Sign(5) na ovoj poziciji, prijam.",sendername);
SendRadioMessage(1,SVETLOPLAVA,string);
GameTextForPlayer(playerid,"~w~Sign ~g~Postavljena!",3000,1);
return 1;
}
else if (rb == 7)
{
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
GetPlayerPos(playerid, plocx, plocy, plocz);
GetPlayerFacingAngle(playerid,ploca);
KreirajBlokadu(3091,plocx,plocy,plocz+0.5,ploca+18 0);
format(string,sizeof(string),"[HQ]: Casnik %s je postavio Line Closed Sign(6) na ovoj poziciji, prijam.",sendername);
SendRadioMessage(1,SVETLOPLAVA,string);
GameTextForPlayer(playerid,"~w~Sign ~g~Postavljena!",3000,1);
return 1;
}
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /KreirajBlokadu %d",d,m,y,h,mi,s,sendername, rb);
CommandLog(string);
}
return 1;
}
//-------------------------------------------------------------------------------

/*------------------------------------------------------------------------------*/
if (strcmp(cmd,"/ukloniblock",true) == 0 || strcmp(cmd, "/skloniblokadu", true) == 0)
{
if(IsPlayerConnected(playerid) && IsACop(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
{
UkloniBlokadu(playerid);
format(string,sizeof(string),"[HQ]: Casnik %s je maknuo blokadu, prijam.",sendername);
SendRadioMessage(1,SVETLOPLAVA,string);
GameTextForPlayer(playerid,"~w~Blokada ~r~Maknuta!",3000,1);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /removeroadblock",d,m,y,h,mi,s,sendername);
CommandLog(string);
}
return 1;
}
/*------------------------------------------------------------------------------*/
if (strcmp(cmd,"sklonisveblokade",true) == 0 || strcmp(cmd, "/ssb", true) == 0)
{
if(IsPlayerConnected(playerid) && IsACop(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
{
if(PlayerInfo[playerid][pRank] >= 5 || PlayerInfo[playerid][pAdmin] >= 2) // This being the default Chief rank in LA-RP change if neccesary.
{
UkloniSveBlokade(playerid);
format(string,sizeof(string),"[HQ]: Casnik %s je maknuo sve blokade u podrucju, prijam.",sendername);
SendRadioMessage(1,SVETLOPLAVA,string);
GameTextForPlayer(playerid,"~b~All ~w~Blokade~r~Maknute!",3000,1);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /removeroadblockall",d,m,y,h,mi,s,sendername);
CommandLog(string);
}
}
return 1;
}

X3nZ
01/09/2011, 07:19 PM
I don't see what you are meaning by this topic.

Are you getting errors? Need help fixing the command or what?

All you did is just posted your /roadblock command.

Dusan01
01/09/2011, 07:21 PM
When i want to complete the filterscript my pawno stop working. Why?? HELP

#include <a_samp>

#define FILTERSCRIPT

forward CommandLog(string[]);
public CommandLog(string[])
}

if(strcmp(cmd, "/block", true) == 0 || strcmp(cmd, "/blokada", true) == 0)


{
if(IsPlayerConnected(playerid) && IsACop(playerid) || IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "KORISTI: /blokada [Broj blokade]");
SendClientMessage(playerid, SVETLOPLAVA, "Available Roadblocks:");
SendClientMessage(playerid, COLOR_GRAD1, "| 1: Mala blokada | 2: Srednja blokada |");
SendClientMessage(playerid, COLOR_GRAD1, "| 3: Velika blodaka | 4: Cone | 5: Detour Sign |");
SendClientMessage(playerid, COLOR_GRAD1, "| 6: Will Be Sign | 7: Line Closed Sign |");
return 1;
}
new rb = strval(tmp);
if (rb == 1)
{
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
GetPlayerPos(playerid, plocx, plocy, plocz);
GetPlayerFacingAngle(playerid,ploca);
KreirajBlokadu(1459,plocx,plocy,plocz,ploca);
format(string,sizeof(string),"[HQ]: Casnik %s je postavio blokadu(1) na ovoj poziciji, prijam.",sendername);
SendRadioMessage(1,SVETLOPLAVA,string);
GameTextForPlayer(playerid,"~w~Blokada ~b~Postavljena!",3000,1);
return 1;
}
else if (rb == 2)
{
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
GetPlayerPos(playerid, plocx, plocy, plocz);
GetPlayerFacingAngle(playerid,ploca);
KreirajBlokadu(978,plocx,plocy,plocz+0.6,ploca);
format(string,sizeof(string),"[HQ]: Casnik %s je postavio blokadu(2) na ovoj poziciji, prijam.",sendername);
SendRadioMessage(1,SVETLOPLAVA,string);
GameTextForPlayer(playerid,"~w~Blokada ~b~Postavljena!",3000,1);
return 1;
}
else if (rb == 3)
{
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
GetPlayerPos(playerid, plocx, plocy, plocz);
GetPlayerFacingAngle(playerid,ploca);
KreirajBlokadu(981,plocx,plocy,plocz+0.9,ploca+180 );
format(string,sizeof(string),"[HQ]: Casnik %s je postavio blokadu(3) na ovoj poziciji, prijam.",sendername);
SendRadioMessage(1,SVETLOPLAVA,string);
GameTextForPlayer(playerid,"~w~Blokada ~g~Postavljena!",3000,1);
SetPlayerPos(playerid, plocx, plocy+1.3, plocz);
return 1;
}
else if (rb == 4)
{
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
GetPlayerPos(playerid, plocx, plocy, plocz);
GetPlayerFacingAngle(playerid,ploca);
KreirajBlokadu(1238,plocx,plocy,plocz+0.2,ploca);
format(string,sizeof(string),"[HQ]: Casnik %s je postavio Traffic Cone(1) na ovoj poziciji, prijam.",sendername);
SendRadioMessage(1,SVETLOPLAVA,string);
GameTextForPlayer(playerid,"~w~Cone ~g~Postavljena!",3000,1);
return 1;
}
else if (rb == 5)
{
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
GetPlayerPos(playerid, plocx, plocy, plocz);
GetPlayerFacingAngle(playerid,ploca);
KreirajBlokadu(1425,plocx,plocy,plocz+0.6,ploca);
format(string,sizeof(string),"[HQ]: Casnik %s je postavio Detour Sign(4) na ovoj poziciji, prijam.",sendername);
SendRadioMessage(1,SVETLOPLAVA,string);
GameTextForPlayer(playerid,"~w~Sign ~g~Postavljena!",3000,1);
return 1;
}
else if (rb == 6)
{
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
GetPlayerPos(playerid, plocx, plocy, plocz);
GetPlayerFacingAngle(playerid,ploca);
KreirajBlokadu(3265,plocx,plocy,plocz-0.5,ploca);
format(string,sizeof(string),"[HQ]: Casnik %s je postavio Will Be Sign(5) na ovoj poziciji, prijam.",sendername);
SendRadioMessage(1,SVETLOPLAVA,string);
GameTextForPlayer(playerid,"~w~Sign ~g~Postavljena!",3000,1);
return 1;
}
else if (rb == 7)
{
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
GetPlayerPos(playerid, plocx, plocy, plocz);
GetPlayerFacingAngle(playerid,ploca);
KreirajBlokadu(3091,plocx,plocy,plocz+0.5,ploca+18 0);
format(string,sizeof(string),"[HQ]: Casnik %s je postavio Line Closed Sign(6) na ovoj poziciji, prijam.",sendername);
SendRadioMessage(1,SVETLOPLAVA,string);
GameTextForPlayer(playerid,"~w~Sign ~g~Postavljena!",3000,1);
return 1;
}
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /KreirajBlokadu %d",d,m,y,h,mi,s,sendername, rb);
CommandLog(string);
}
return 1;
}
//-------------------------------------------------------------------------------

/*------------------------------------------------------------------------------*/
if (strcmp(cmd,"/ukloniblock",true) == 0 || strcmp(cmd, "/skloniblokadu", true) == 0)
{
if(IsPlayerConnected(playerid) && IsACop(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
{
UkloniBlokadu(playerid);
format(string,sizeof(string),"[HQ]: Casnik %s je maknuo blokadu, prijam.",sendername);
SendRadioMessage(1,SVETLOPLAVA,string);
GameTextForPlayer(playerid,"~w~Blokada ~r~Maknuta!",3000,1);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /removeroadblock",d,m,y,h,mi,s,sendername);
CommandLog(string);
}
return 1;
}
/*------------------------------------------------------------------------------*/
if (strcmp(cmd,"sklonisveblokade",true) == 0 || strcmp(cmd, "/ssb", true) == 0)
{
if(IsPlayerConnected(playerid) && IsACop(playerid) || PlayerInfo[playerid][pAdmin] >= 2)
{
if(PlayerInfo[playerid][pRank] >= 5 || PlayerInfo[playerid][pAdmin] >= 2) // This being the default Chief rank in LA-RP change if neccesary.
{
UkloniSveBlokade(playerid);
format(string,sizeof(string),"[HQ]: Casnik %s je maknuo sve blokade u podrucju, prijam.",sendername);
SendRadioMessage(1,SVETLOPLAVA,string);
GameTextForPlayer(playerid,"~b~All ~w~Blokade~r~Maknute!",3000,1);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /removeroadblockall",d,m,y,h,mi,s,sendername);
CommandLog(string);
}
}
return 1;
}

Improvement™
01/09/2011, 07:33 PM
Ehh, What is this bracket doing on top of the script? Try compiling after removing it.

forward CommandLog(string[]);
public CommandLog(string[])
} <---------------------------------------------------------------------------------------------------------

if(strcmp(cmd, "/block", true) == 0 || strcmp(cmd, "/blokada", true) == 0)

Dusan01
01/09/2011, 07:35 PM
I try and errors.


C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(9) : error 017: undefined symbol "cmd"
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(13) : error 017: undefined symbol "playerid"
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(15) : error 017: undefined symbol "tmp"
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(15) : error 017: undefined symbol "strtok"
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(16) : error 017: undefined symbol "tmp"
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(18) : error 017: undefined symbol "playerid"
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(19) : error 017: undefined symbol "playerid"
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(20) : error 017: undefined symbol "playerid"
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(21) : error 017: undefined symbol "playerid"
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(22) : error 017: undefined symbol "playerid"
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(25) : error 017: undefined symbol "tmp"
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(28) : error 017: undefined symbol "playerid"
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(30) : error 017: undefined symbol "playerid"
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(31) : error 017: undefined symbol "playerid"
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(32) : error 017: undefined symbol "KreirajBlokadu"
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(33) : warning 224: indeterminate array size in "sizeof" expression (symbol "")
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(33) : error 017: undefined symbol "sendername"
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(34) : error 004: function "SendRadioMessage" is not implemented
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(35) : error 017: undefined symbol "playerid"
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(40) : error 017: undefined symbol "playerid"
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(42) : error 017: undefined symbol "playerid"
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(43) : error 017: undefined symbol "playerid"
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(44) : error 017: undefined symbol "KreirajBlokadu"
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(45) : warning 224: indeterminate array size in "sizeof" expression (symbol "")
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(45) : error 017: undefined symbol "sendername"
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(46) : error 004: function "SendRadioMessage" is not implemented
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(47) : error 017: undefined symbol "playerid"
C:\Users\Korisnik-d\Desktop\123 ko je bot.pwn(52) : error 017: undefined symbol "playerid"

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


26 Errors.

[MG]Dimi
01/09/2011, 09:48 PM
public CommandLog(playerid,string[])
{