Help with roadblock -
123bob123 - 21.08.2014
I need some help in this, i want to make the rb only if your in swat skin you can use it:
Help pls
pawn Код:
#define MAX_ROADBLOCKS 20
enum Roadblocks
{
rCreated,
rOwner,
rObject
}
new rInfo[MAX_ROADBLOCKS][Roadblocks];
CMD:rb(playerid, params[])
{
new pId;
new pskin = GetPlayerSkin(playerid);
if(pskin == 285) return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Only S.W.A.T may use this command!");
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
for(new i = 0;i < sizeof(rInfo); i++)
{
if(rInfo[i][rCreated] == 0)
{
rInfo[i][rCreated] = 1;
rInfo[i][rOwner] = playerid;
rInfo[i][rObject] = CreateObject(978, X, Y, Z, 0.0, 0.0, A);
}
}
SendClientMessage(playerid, COLOR_LIGHTBLUE, "S.W.A.T Roadblock Placed!");
return 1;
}
CMD:drb(playerid, params[])
{
if(pskin == 285) return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Only S.W.A.T may use this command!");
for(new i = 0; i < sizeof(rInfo); i++)
{
if(rInfo[i][rCreated] == 1)
{
if(rInfo[i][rOwner] == playerid)
{
DestroyObject(rInfo[i][rObject]);
}
}
}
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Roadblocks removed!");
return 1;
}
Re: Help with roadblock -
MicroD - 21.08.2014
in both commands.
Re: Help with roadblock -
123bob123 - 21.08.2014
Quote:
Originally Posted by MicroD
|
I've did in both, check it out
Re: Help with roadblock -
TLN - 21.08.2014
pawn Код:
CMD:rb(playerid, params[])
{
new pId;
new pskin = GetPlayerSkin(playerid);
if(pskin != 285) return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Only S.W.A.T may use this command!");
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
for(new i = 0;i < sizeof(rInfo); i++)
{
if(rInfo[i][rCreated] == 0)
{
rInfo[i][rCreated] = 1;
rInfo[i][rOwner] = playerid;
rInfo[i][rObject] = CreateObject(978, X, Y, Z, 0.0, 0.0, A);
}
}
SendClientMessage(playerid, COLOR_LIGHTBLUE, "S.W.A.T Roadblock Placed!");
return 1;
}
CMD:drb(playerid, params[])
{
if(pskin != 285) return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Only S.W.A.T may use this command!");
for(new i = 0; i < sizeof(rInfo); i++)
{
if(rInfo[i][rCreated] == 1)
{
if(rInfo[i][rOwner] == playerid)
{
DestroyObject(rInfo[i][rObject]);
}
}
}
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Roadblocks removed!");
return 1;
}
Re: Help with roadblock -
Threshold - 21.08.2014
pawn Код:
CMD:rb(playerid, params[])
{
if(GetPlayerSkin(playerid) != 285) return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Only S.W.A.T may use this command!");
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
for(new i = 0; i < sizeof(rInfo); i++)
{
if(rInfo[i][rCreated]) continue;
rInfo[i][rCreated] = 1;
rInfo[i][rOwner] = playerid;
rInfo[i][rObject] = CreateObject(978, X, Y, Z, 0.0, 0.0, A);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "S.W.A.T Roadblock Placed!");
return 1;
}
SendClientMessage(playerid, -1, "Failed to place roadblock.");
return 1;
}
CMD:drb(playerid, params[])
{
if(GetPlayerSkin(playerid) != 285) return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Only S.W.A.T may use this command!");
for(new i = 0; i < sizeof(rInfo); i++)
{
if(!rInfo[i][rCreated]) continue;
if(rInfo[i][rOwner] != playerid) continue;
DestroyObject(rInfo[i][rObject]);
}
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Roadblocks removed!");
return 1;
}
:l
Re: Help with roadblock -
123bob123 - 21.08.2014
pawn Код:
filterscripts\SWAT.pwn(30) : warning 203: symbol is never used: "drb"
filterscripts\SWAT.pwn(30 -- 42) : warning 203: symbol is never used: "rb"
filterscripts\SWAT.pwn(30 -- 42) : error 013: no entry point (no public functions)
Re: Help with roadblock -
Threshold - 21.08.2014
You need to have zcmd included.
Re: Help with roadblock -
123bob123 - 22.08.2014
Help pls
Errors:
pawn Код:
\pawno\include\ZCMD.inc(62) : warning 235: public function lacks forward declaration (symbol "OnGameModeInit")
\pawno\include\ZCMD.inc(64) : error 017: undefined symbol "funcidx"
pawno\include\ZCMD.inc(65) : error 017: undefined symbol "funcidx"
\include\ZCMD.inc(66) : error 017: undefined symbol "funcidx"
pawno\include\ZCMD.inc(68) : error 017: undefined symbol "CallLocalFunction"
pawno\include\ZCMD.inc(83) : warning 235: public function lacks forward declaration (symbol "OnPlayerCommandText")
pawno\include\ZCMD.inc(85) : error 017: undefined symbol "CallLocalFunction"
pawno\include\ZCMD.inc(94) : error 017: undefined symbol "tolower"
pawno\include\ZCMD.inc(96) : warning 217: loose indentation
pawno\include\ZCMD.inc(96) : error 017: undefined symbol "format"
pawno\include\ZCMD.inc(96) : warning 202: number of arguments does not match definition
pawno\include\ZCMD.inc(96) : warning 202: number of arguments does not match definition
pawno\include\ZCMD.inc(96) : warning 202: number of arguments does not match definition
pawno\include\ZCMD.inc(97) : warning 217: loose indentation
pawno\include\ZCMD.inc(98) : warning 217: loose indentation
pawno\include\ZCMD.inc(102) : error 017: undefined symbol "CallLocalFunction"
pawno\include\ZCMD.inc(104) : error 017: undefined symbol "CallLocalFunction"
pawno\include\ZCMD.inc(108) : error 017: undefined symbol "CallLocalFunction"
pawno\include\ZCMD.inc(110) : error 017: undefined symbol "CallLocalFunction"
filterscripts\SWAT.pwn(16) : error 017: undefined symbol "GetPlayerSkin"
filterscripts\SWAT.pwn(17) : error 017: undefined symbol "SendClientMessage"
filterscripts\SWAT.pwn(19) : error 017: undefined symbol "GetPlayerPos"
filterscripts\SWAT.pwn(20) : error 017: undefined symbol "GetPlayerFacingAngle"
filterscripts\SWAT.pwn(27) : error 017: undefined symbol "CreateObject"
filterscripts\SWAT.pwn(30) : error 017: undefined symbol "SendClientMessage"
filterscripts\SWAT.pwn(18) : warning 203: symbol is never used: "A"
filterscripts\SWAT.pwn(18) : warning 203: symbol is never used: "Z"
filterscripts\SWAT.pwn(18) : warning 203: symbol is never used: "Y"
filterscripts\SWAT.pwn(18) : warning 203: symbol is never used: "X"
filterscripts\SWAT.pwn(15) : warning 203: symbol is never used: "pId"
filterscripts\SWAT.pwn(15 -- 36) : error 017: undefined symbol "pskin"
filterscripts\SWAT.pwn(36) : error 017: undefined symbol filterscripts\SWAT.pwn(36) : fatal error 107: too many error messages on one line
Code:
pawn Код:
#include ZCMD
#define MAX_ROADBLOCKS 20
enum Roadblocks
{
rCreated,
rOwner,
rObject
}
new rInfo[MAX_ROADBLOCKS][Roadblocks];
CMD:rb(playerid, params[])
{
new pId;
new pskin = GetPlayerSkin(playerid);
if(pskin != 285) return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Only S.W.A.T may use this command!");
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
for(new i = 0;i < sizeof(rInfo); i++)
{
if(rInfo[i][rCreated] == 0)
{
rInfo[i][rCreated] = 1;
rInfo[i][rOwner] = playerid;
rInfo[i][rObject] = CreateObject(978, X, Y, Z, 0.0, 0.0, A);
}
}
SendClientMessage(playerid, COLOR_LIGHTBLUE, "S.W.A.T Roadblock Placed!");
return 1;
}
CMD:drb(playerid, params[])
{
if(pskin != 285) return SendClientMessage(playerid, -1, "{FF0000}Error: {FFFFFF}Only S.W.A.T may use this command!");
for(new i = 0; i < sizeof(rInfo); i++)
{
if(rInfo[i][rCreated] == 1)
{
if(rInfo[i][rOwner] == playerid)
{
DestroyObject(rInfo[i][rObject]);
}
}
}
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Roadblocks removed!");
return 1;
}
Re: Help with roadblock -
TLN - 22.08.2014
Re: Help with roadblock -
123bob123 - 22.08.2014
got same errors help