Help in RB -
Adornil - 31.12.2015
Help Guys help in Road block please
PHP код:
CMD:roadblock(playerid, params[])
{
new Float:X,Float:Y,Float:Z,Float:A;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,A);
roadblock = CreateObject(981,X,Y-1,Z-0.3,0,0,0);
return 1;
}
CMD:drb(playerid, params[])
DestroyObject(roadblock);
return 1;
}
Код:
E:\DynamicGateSystem\bb_freeroam.pwn(22550) : error 017: undefined symbol "roadblock"
E:\DynamicGateSystem\bb_freeroam.pwn(22555) : error 017: undefined symbol "roadblock"
E:\DynamicGateSystem\bb_freeroam.pwn(22556) : error 010: invalid function or declaration
E:\DynamicGateSystem\bb_freeroam.pwn(1283) : warning 204: symbol is assigned a value that is never used: "Fired"
E:\DynamicGateSystem\bb_freeroam.pwn(1283 -- 28315) : warning 203: symbol is never used: "bandanatext"
E:\DynamicGateSystem\bb_freeroam.pwn(1283 -- 28315) : warning 203: symbol is never used: "captext"
E:\DynamicGateSystem\bb_freeroam.pwn(1283 -- 28315) : warning 203: symbol is never used: "glassestext"
E:\DynamicGateSystem\bb_freeroam.pwn(1283 -- 28315) : warning 203: symbol is never used: "hattext"
E:\DynamicGateSystem\bb_freeroam.pwn(1283 -- 28315) : warning 203: symbol is never used: "helmettext"
E:\DynamicGateSystem\bb_freeroam.pwn(1283 -- 28315) : warning 203: symbol is never used: "masktext"
E:\DynamicGateSystem\bb_freeroam.pwn(1283 -- 28315) : warning 203: symbol is never used: "watchtext"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
3 Errors.
Re: Help in RB -
Stones - 31.12.2015
Код:
CMD:rb(playerid, params[])
return cmd_roadblock(playerid, params);
CMD:roadblock(playerid,params[])
{
new number, atrb = atblock[playerid];
if(sscanf(params,"d",number))
{
SendClientMessage(playerid,COLOR_LIGHTBLUE,"USAGE: /rb <1/2/3/4>");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| 1: Small Roadblock");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| 2: Barrier");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| 3: Traffic cone");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| 4: Detour sign");
SendClientMessage(playerid,COLOR_WHITE,"----------------------");
format(string, sizeof string,"The roadblock will expire after %i minutes, or use /REMOVEBLOCK for remove the lastest block.",EXPIRE_MINUTES);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
return 1;
}
switch(number)
{
case 1:
{
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
if(atblock[playerid] < MAX_ROADBLOCKS)
{
block[atrb][playerid] = CreateObject(1459, X, Y+1, Z-0.5,0,0,A);
GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
#if SEND == true
GetPlayerName(playerid,pName,32);
format(string,sizeof (string)," %s added a roadblock(%i).",pName,number);
SendClientMessageToAll(COLOR_GREEN, string);
#else
SetTimerEx("ExpireRoadblock", EXPIRE_MINUTES*60000, false, "i", block[atrb][playerid]);
atblock[playerid] += 1;
#endif
} else {
format(string,sizeof string,"You cannot place more then %i Roadblocks!",MAX_ROADBLOCKS);
SendClientMessage(playerid, COLOR_RED, string);
}
return 1;
}
case 2:
{
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
if(atblock[playerid] < MAX_ROADBLOCKS)
{
block[atrb][playerid] = CreateObject(978, X, Y+1, Z,0,0,A);
GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
#if SEND == true
GetPlayerName(playerid,pName,32);
format(string,sizeof string,"%s added a roadblock(%i).",pName,number);
SendClientMessageToAll(COLOR_GREEN, string);
#else
SetTimerEx("ExpireRoadblock", EXPIRE_MINUTES*60000, false, "i", block[atrb][playerid]);
atblock[playerid] += 1;
#endif
} else {
format(string,sizeof string,"You cannot place more then %i Roadblocks!",MAX_ROADBLOCKS);
SendClientMessage(playerid, COLOR_RED, string);
}
return 1;
}
case 3:
{
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
if(atblock[playerid] < MAX_ROADBLOCKS)
{
block[atrb][playerid] = CreateObject(1238, X, Y+1, Z-0.5, 0, 0.0,A);
GameTextForPlayer(playerid,"~w~Cone ~b~Placed!",3000,1);
#if SEND == true
GetPlayerName(playerid,pName,32);
format(string,sizeof string," %s added a roadblock(%i).",pName,number);
SendClientMessageToAll(COLOR_GREEN, string);
#else
SetTimerEx("ExpireRoadblock", EXPIRE_MINUTES*60000, false, "i", block[atrb][playerid]);
atblock[playerid] += 1;
#endif
} else {
format(string,sizeof string,"You cannot place more then %i Roadblocks!",MAX_ROADBLOCKS);
SendClientMessage(playerid, COLOR_RED, string);
}
return 1;
}
case 4:
{
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
if(atblock[playerid] < MAX_ROADBLOCKS)
{
block[atrb][playerid] = CreateObject(1425, X, Y+1, Z-0.5, 0, 0.0,A,300);
GameTextForPlayer(playerid,"~w~Sign ~b~Placed!",3000,1);
#if SEND == true
GetPlayerName(playerid,pName,32);
format(string,sizeof string," %s added a roadblock(%i).",pName,number);
SendClientMessageToAll(COLOR_GREEN, string);
#else
SetTimerEx("ExpireRoadblock", EXPIRE_MINUTES*60000, false, "i", block[atrb][playerid]);
atblock[playerid] += 1;
#endif
} else {
format(string,sizeof string,"You cannot place more then %i Roadblocks!",MAX_ROADBLOCKS);
SendClientMessage(playerid, COLOR_RED, string);
}
return 1;
}
}
return 1;
}
forward ExpireRoadblock(blockid);
public ExpireRoadblock(blockid)
{
DestroyObject(blockid);
return 1;
}
Код:
CMD:removeblock(playerid,params[])
{
for(new i=0;i<=sizeof(block);i++) DestroyObject(block[i][playerid]);
return 1;
}
Re: Help in RB -
SoFahim - 31.12.2015
Just add one line in the CMD , in CMD:roadblock
Just delete to avoid those warnings of never used
PHP код:
new Fired;
new bandanatext;
new captext;
new glassestext;
new hattext;
new helmettext;
new masktext;
new watchtex;
Re: Help in RB -
CodeStyle175 - 31.12.2015
PHP код:
CMD:roadblock(playerid,params[])
{
new number, atrb = atblock[playerid];
if(sscanf(params,"d",number) || number < 1 || number > 4)
{
SendClientMessage(playerid,COLOR_LIGHTBLUE,"USAGE: /rb <1/2/3/4>");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| 1: Small Roadblock");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| 2: Barrier");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| 3: Traffic cone");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"| 4: Detour sign");
SendClientMessage(playerid,COLOR_WHITE,"----------------------");
format(string, sizeof string,"The roadblock will expire after %i minutes, or use /REMOVEBLOCK for remove the lastest block.",EXPIRE_MINUTES);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
return 1;
}
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
if(atblock[playerid] >= MAX_ROADBLOCKS){
format(string,sizeof string,"You cannot place more then %i Roadblocks!",MAX_ROADBLOCKS);
SendClientMessage(playerid, COLOR_RED, string);
return 1;
}
switch(number){
case 1:{
block[atrb][playerid] = CreateObject(1459, X, Y+1, Z-0.5,0,0,A);
GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
}
case 2:{
block[atrb][playerid] = CreateObject(978, X, Y+1, Z,0,0,A);
GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
}
case 3:{
block[atrb][playerid] = CreateObject(1238, X, Y+1, Z-0.5, 0, 0.0,A);
GameTextForPlayer(playerid,"~w~Cone ~b~Placed!",3000,1);
}
case 4:{
block[atrb][playerid] = CreateObject(1425, X, Y+1, Z-0.5, 0, 0.0,A,300);
GameTextForPlayer(playerid,"~w~Sign ~b~Placed!",3000,1);
}
}
#if SEND == true
GetPlayerName(playerid,pName,32);
format(string,sizeof string," %s added a roadblock(%i).",pName,number);
SendClientMessageToAll(COLOR_GREEN, string);
#else
SetTimerEx("ExpireRoadblock", EXPIRE_MINUTES*60000, false, "i", block[atrb][playerid]);
atblock[playerid] += 1;
#endif
return 1;
}
Re: Help in RB -
J4Rr3x - 31.12.2015
Код:
// In top of your gamemode
new roadblock;
// Commands:
CMD:roadblock(playerid, params[]) {
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
roadblock = CreateObject(981, X, Y - 1, Z- 0.3, 0, 0, 0);
return 1;
}
CMD:drb(playerid, params[]) {
DestroyObject(roadblock);
return 1;
}
For the warnings you need to delete variables:
Код:
bandanatext
captext
glassestext
hattext
helmettext
masktext
watchtex