Problem With Command Creating -
Serifukas - 27.05.2011
Hi All.I Have Code Like This And I Want To Do A Command For It.To Turn On Security Or Turn Off..I Try Do That By My Self But I don't know how to make it.If you know and can help me please help
Код:
public OnPlayerUpdate(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 32.0, -2904.4456,472.9688,4.9141))
{
if(playerDB[playerid][specialybe] != 1)
{
new Float:burnx, Float:burny, Float:burnz; GetPlayerPos(playerid,burnx, burny, burnz); CreateExplosion(burnx, burny , burnz, 7,10.0);//Explode
SetPlayerHealth(playerid,0);
SendClientMessage(playerid,COLOR_WHITE,"* You Ar Intruder So You Been Removed From This Place!!!.");
new msg[128],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(msg,sizeof(msg),"**[Security] %s Try to intrude to your police place.",name);
SendMessageToCops(COLOR,msg);//MSG TO COPS
}else{
GameTextForPlayer(playerid,"Welcome",2500,3);
}
return 1;
}
return 1;
}
I Want Do Like This To Turn Function Or Off..
Код:
if(!strcmp(cmdtext, "/on", true,8))
{
///Action-Function...
if(!strcmp(cmdtext, "/off", true,8))
{
///Action-Function...
Re: Problem With Command Creating -
Elka_Blazer - 27.05.2011
On the top of your script
Replace
pawn Код:
public OnPlayerUpdate(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 32.0, -2904.4456,472.9688,4.9141))
{
if(playerDB[playerid][specialybe] != 1)
{
new Float:burnx, Float:burny, Float:burnz; GetPlayerPos(playerid,burnx, burny, burnz); CreateExplosion(burnx, burny , burnz, 7,10.0);//Explode
SetPlayerHealth(playerid,0);
SendClientMessage(playerid,COLOR_WHITE,"* You Ar Intruder So You Been Removed From This Place!!!.");
new msg[128],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(msg,sizeof(msg),"**[Security] %s Try to intrude to your police place.",name);
SendMessageToCops(COLOR,msg);//MSG TO COPS
}else{
GameTextForPlayer(playerid,"Welcome",2500,3);
}
return 1;
}
return 1;
}
With
pawn Код:
public OnPlayerUpdate(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 32.0, -2904.4456,472.9688,4.9141))
{
if(playerDB[playerid][specialybe] != 1 && publicmode == 1)
{
new Float:burnx, Float:burny, Float:burnz; GetPlayerPos(playerid,burnx, burny, burnz); CreateExplosion(burnx, burny , burnz, 7,10.0);//Explode
SetPlayerHealth(playerid,0);
SendClientMessage(playerid,COLOR_WHITE,"* You Ar Intruder So You Been Removed From This Place!!!.");
new msg[128],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(msg,sizeof(msg),"**[Security] %s Try to intrude to your police place.",name);
SendMessageToCops(COLOR,msg);//MSG TO COPS
}else{
GameTextForPlayer(playerid,"Welcome",2500,3);
}
return 1;
}
return 1;
}
Now the commands
pawn Код:
if(!strcmp(cmdtext, "/on", true,8))
{
publicmode = 1;
return 1;
}
if(!strcmp(cmdtext, "/off", true,8))
{
publicmode = 0;
return 1;
}
Re: Problem With Command Creating -
Serifukas - 27.05.2011
Thanks I Think Is Good But How Fix This I Add New publicmode=1;
error 017: undefined symbol "publicmode"
warning 215: expression has no effect
Re: Problem With Command Creating -
SchurmanCQC - 27.05.2011
Its
not
Re: Problem With Command Creating -
Serifukas - 27.05.2011
Now Warrning:
warning 204: symbol is assigned a value that is never used: "publicmode"
Re: Problem With Command Creating -
Wesley221 - 27.05.2011
Add under "OnPlayerSpawn"
Re: Problem With Command Creating -
Serifukas - 27.05.2011
Now Looks Like This.
error 017: undefined symbol "publicmode"
warning 215: expression has no effect
error 017: undefined symbol "publicmode"
warning 215: expression has no effect
error 017: undefined symbol "publicmode"
warning 215: expression has no effect
Re: Problem With Command Creating -
Serifukas - 28.05.2011
Maybe Can Someone Help Me ?