if (strcmp("/loadiron", cmdtext,true,10) == 0)
{
IsPlayerInRangeOfPoint(playerid,2.0,-2454.5771,2254.1755,4.9802);
PlayerInfo[playerid][pIron]++;
PlayerInfo[playerid][pIron]++;
PlayerInfo[playerid][pIron]++;
PlayerInfo[playerid][pIron]++;
PlayerInfo[playerid][pIron]++;
SendClientMessage(playerid,COLOR_PURPLE,"You Have Loaded In 5 Pieces of Iron!");
}
else
{
!IsPlayerInRangeOfPoint(playerid,2.0,-2454.5771,2254.1755,4.9802);
SendClientMessage(playerid,COLOR_RED,"You are not at the warehouse!");
return 1;
}
pawn Код:
|
if(IsPlayerInRangeOfPoint(playerid,2.0,-2454.5771,2254.1755,4.9802))//this is when he's in range of that point
{
//do something
}
if(!IsPlayerInRangeOfPoint(playerid,2.0,-2454.5771,2254.1755,4.9802))//and this with the " ! " when hes not
{
//do something
}
//or just:
if(IsPlayerInRangeOfPoint(playerid,2.0,-2454.5771,2254.1755,4.9802))//this is when he's in range of that point
{
//do something
}
else//when the first condition equals "false"
{
//do something when hes not
}
if (strcmp("/loadiron", cmdtext,true,10) == 0)
{
if(!IsPlayerInRangeOfPoint(playerid,2.0,-2454.5771,2254.1755,4.9802)) return SendClientMessage(playerid,COLOR_RED,"You are not at the warehouse!");
PlayerInfo[playerid][pIron]++;
PlayerInfo[playerid][pIron]++;
PlayerInfo[playerid][pIron]++;
PlayerInfo[playerid][pIron]++;
PlayerInfo[playerid][pIron]++;
SendClientMessage(playerid,COLOR_PURPLE,"You Have Loaded In 5 Pieces of Iron!");
return 1;
}
PlayerInfo[playerid][pIron]++;
PlayerInfo[playerid][pIron]++;
PlayerInfo[playerid][pIron]++;
PlayerInfo[playerid][pIron]++;
PlayerInfo[playerid][pIron]++;
PlayerInfo[playerid][pIron] += 5;