Need help with object
#2

instead of placing the variables inside the
Код:
public OnPlayerCommandText(playerid, cmdtext[])
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:
Код:
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
}
then on the player placing bomb you do it like this
Код:
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 :)
Hope you understood something of all this mess
Reply


Messages In This Thread
Need help with object - by Kain1297 - 27.07.2012, 01:19
Re: Need help with object - by Ranama - 27.07.2012, 01:32
Respuesta: Need help with object - by Kain1297 - 27.07.2012, 01:44
Re: Need help with object - by Devilxz97 - 27.07.2012, 01:46
Respuesta: Need help with object - by Kain1297 - 27.07.2012, 01:48

Forum Jump:


Users browsing this thread: 1 Guest(s)