PDA

View Full Version : Little help


Trawltrawl
23/11/2012, 05:05 PM
Hey just a simple question,
I'm making a command but i have a problem

if (strcmp("/blow", cmdtext, true, 10) == 0)
{
if(GetPlayerSkin(playerid == 111) & (IsPlayerInRangeOfPoint(playerid, 3908.1470,-2664.6038,0.8423, 5))
{
CreateExplosion(0,0,0,0,0);
}
else
{
SendClientMessage(playerid, COLOR_AQUA,"(!):{FFFFFF}You are not near a field gun");
}
return 1;
}


How I can make this possible? That if the player skin is 111 and the player is in range of point 5, the explosion will appear?

park4bmx
23/11/2012, 05:41 PM
many errors in this code

if (strcmp("/blow", cmdtext, true, 10) == 0)
{
if(GetPlayerSkin(playerid) == 111 && (IsPlayerInRangeOfPoint(playerid, 3908.1470,-2664.6038,0.8423, 5))
{
CreateExplosion(0,0,0,0,0);
}else return SendClientMessage(playerid, COLOR_AQUA,"(!):{FFFFFF}You are not near a field gun");
return 1;
}


Explained
GetPlayerSkin returns the players skinid, but it returns it outside the parameters!
To do a double check you use: &&.
the rest is all fine

xMCx
23/11/2012, 05:49 PM
if (strcmp("/blow", cmdtext, true, 10) == 0)
{
if(GetPlayerSkin(playerid) == 111 && (IsPlayerInRangeOfPoint(playerid, 5.0,3908.1470,-2664.6038,0.8423))//5 should be the first
{
CreateExplosion(0,0,0,0,0);//0 wont create explosion
}else return SendClientMessage(playerid, COLOR_AQUA,"(!):{FFFFFF}You are not near a field gun");
return 1;
}

Trawltrawl
23/11/2012, 05:52 PM
Oh okay! Thanks for replying!
-
Just a quick thing
How to set sea waves?

park4bmx
23/11/2012, 07:34 PM
Oh okay! Thanks for replying!
-
Just a quick thing
How to set sea waves?

not possible