26.06.2011, 12:46
hi , so i made a dm.
There and i made a variable to check and put a player in that dm.
Thats the last command and the return 0 etc.
You can see I added a check to see whether they are in the war/dm or not.
But I can teleport out of it , I don't see anything wrong. i even put InWar = 0;
On connect. why isn't it working ?
oh I do have more commands but only showed one.
Please help , thanks
pawn Код:
if(strcmp(cmdtext, "/war", true) == 0)
{ InWar[playerid] = 1;
SetPlayerWorldBounds(playerid, 443.7593, -93.423, 2160.407, 1599.869);
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "DM: %s has joined The WAR! (/war) to join aswell!", pName);
SendClientMessageToAll(COLOR_GREEN, string);
SetPlayerPos(playerid,239.5148, 1813.7039, 500.6836);
GivePlayerWeapon(playerid, 46, 1);
GivePlayerWeapon(playerid,29,50000);
GivePlayerWeapon(playerid,16,50000);
GivePlayerWeapon(playerid,31,25);
GivePlayerWeapon(playerid,16,50000);
GivePlayerWeapon(playerid,34,50);
return 1;
}
pawn Код:
if (strcmp(cmdtext, "/plant", true)==0)
{
if(BombArmed[playerid] == false)
{
GetPlayerPos(playerid, BombX[playerid], BombY[playerid], BombZ[playerid]);
GetXYInFrontOfPlayer(playerid, BombX[playerid], BombY[playerid], 0.7);
SendClientMessage(playerid, 0x0066FFAA, "Bomb Planted (exploding in 10 seconds).");
ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
BombObject[playerid] = CreateObject(1252, BombX[playerid], BombY[playerid], BombZ[playerid] - 0.8,270,0,0);
SetTimerEx("BombTimer",10000,0, "d", playerid);
BombArmed[playerid] = true;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You can only place a single bomb at a time!");
}
return 1;
}
if(InWar[playerid] != 0) return SendClientMessage(playerid, COLOR_RED, "You can't use commands in war use /leave to leave.");
return 0;
}
You can see I added a check to see whether they are in the war/dm or not.
But I can teleport out of it , I don't see anything wrong. i even put InWar = 0;
On connect. why isn't it working ?
oh I do have more commands but only showed one.
Please help , thanks