27.07.2012, 01:32
instead of placing the variables inside the
You'll have to put the variables in the local scope (at the start of the script before OnGameModeInit)
But you'll need to create an aray if you want to be able to place more bombs then one and then you'll do it like this:
if you want every player to be able to place one bomb you'll do:
then on the player placing bomb you do it like this
Hope you understood something of all this mess
Код:
public OnPlayerCommandText(playerid, cmdtext[])
But you'll need to create an aray if you want to be able to place more bombs then one and then you'll do it like this:
if you want every player to be able to place one bomb you'll do:
Код:
new Float:PlayerBombX[MAX_PLAYERS], Float:PlayerBombY[MAX_PLAYERS], Float:PlayerBombZ[MAX_PLAYERS]; // This will create a variable where you can place your float wich you get from the function // And of course you'll need one for each thing, x,y and z //and here come rest of the code like OnGameModeInit(){//etc }
Код:
GetPlayerPos(playerid, PlayerBombX[playerid], PlayerBombY[playerid], PlayerBombZ[playerid] //and on the defuse you'll do IsPlayerInRangeOfPoint(playerid, 10.5,PlayerBombX[playerid], PlayerBombY[playerid], PlayerBombZ[playerid]) //and on the detonate you'll do like CreateExplosion(PlayerBombX[playerid], PlayerBombY[playerid], PlayerBombZ[playerid]); // I don't know if that's the right function but you'll get the point i hope :)