[+REP]Help me Please -
Alpha000 - 07.11.2015
Hello everyone.
First here is my code :
PHP код:
CMD:lands(playerid, params[])
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
for(new x; x < MAX_LANDS; x++)
{
if (PlayerInfo[playerid][pLandPerms] == 0) return SendClientMessage(playerid, COLOR_GREY, "You don't own any land.");
if(IsPlayerInGangZone(playerid, LandInfo[x][landZone]))
return SendClientMessage(playerid, COLOR_GREY, "You are in your land.");
else SendClientMessage(playerid, COLOR_GREY, "You are not in your land.");
{
if(strcmp(playername, LandInfo[x][landOwner], true) == 0)
{
editingLand[playerid] = x;
break;
}
else
{
editingLand[playerid] = -1;
}
}
}
ShowPlayerDialogEx(playerid, LANDSMAIN,DIALOG_STYLE_LIST, "Lands - Select an option", "Toggle Lands on Map\nBuild\nEdit a Building\nDestroy a Building\nBuy Land\nSell Land\nDestroy all objects", "Select", "Cancel");
return 1;
}
Okay now as you can see in my code IF the player is in its land it should show him "you are in land"
and IF the player is not in land it should show him that "you are NOT in your land"
BUT when i type /lands in game it says "you are NOT in your land" also with this it shows me the dialog as /lands...
any help please [+REP]
Re: [+REP]Help me Please -
ThePhenix - 07.11.2015
You gotta learn how to use control structures.
https://sampwiki.blast.hk/wiki/Control_Structures#if
Re: [+REP]Help me Please -
Alpha000 - 07.11.2015
aw i will learn but also can you help me with it please?
Re: [+REP]Help me Please -
Alpha000 - 07.11.2015
anyone please
[+REP] for help
Re: [+REP]Help me Please -
Mencent - 07.11.2015
Hello!
Do you mean it like this?
PHP код:
CMD:lands(playerid,params[])
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
if(PlayerInfo[playerid][pLandPerms] == 0)return SendClientMessage
for(new x;x<MAX_LANDS;x++)
{
if(IsPlayerInGangZone(playerid,LandInfo[x][landZone]))
{
if(!strcmp(playername,LandInfo[x][landOwner],true))
{
editingLand[playerid] = x;
ShowPlayerDialogEx(playerid, LANDSMAIN,DIALOG_STYLE_LIST, "Lands - Select an option", "Toggle Lands on Map\nBuild\nEdit a Building\nDestroy a Building\nBuy Land\nSell Land\nDestroy all objects", "Select", "Cancel");
return SendClientMessage(playerid,COLOR_GREY,"You are in your land!");
}
else
{
editingLand[playerid] = -1;
}
}
}
return SendClientMessage(playerid,COLOR_GREY,"You are not in your land!");
}
Re: [+REP]Help me Please -
Alpha000 - 07.11.2015
now it always says you are not in your land and dont open dialog even im in my land
Re: [+REP]Help me Please -
Alpha000 - 07.11.2015
any help?
Re: [+REP]Help me Please -
DeathCore - 07.11.2015
Код:
CMD:lands(playerid, params[])
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pLandPerms] == 0) return SendClientMessage(playerid, COLOR_GREY, "You don't own any land.");
for(new x; x < MAX_LANDS; x++)
{
if(strcmp(playername, LandInfo[x][landOwner], true) == 0)
{
if(IsPlayerInGangZone(playerid, LandInfo[x][landZone]))
{
SendClientMessage(playerid,COLOR_GREY,"You are in your land!");
editingLand[playerid] = x;
ShowPlayerDialogEx(playerid, LANDSMAIN,DIALOG_STYLE_LIST, "Lands - Select an option", "Toggle Lands on Map\nBuild\nEdit a Building\nDestroy a Building\nBuy Land\nSell Land\nDestroy all objects", "Select", "Cancel");
break;
}
return SendClientMessage(playerid, COLOR_GREY, "You are not in your land.");
}
editingLand[playerid] = -1;
}
return 1;
}
Re: [+REP]Help me Please -
Alpha000 - 08.11.2015
same...
Re: [+REP]Help me Please -
Alpha000 - 09.11.2015
any help please?
[+REP]