SA-MP Forums Archive
[+REP]Help me Please - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [+REP]Help me Please (/showthread.php?tid=593570)



[+REP]Help me Please - Alpha000 - 07.11.2015

Hello everyone.
First here is my code :
PHP код:
CMD:lands(playeridparams[])
{
    new 
playername[MAX_PLAYER_NAME];
    
GetPlayerName(playeridplayernamesizeof(playername));
    for(new 
xMAX_LANDSx++)
    {
    if (
PlayerInfo[playerid][pLandPerms] == 0) return  SendClientMessage(playeridCOLOR_GREY"You don't own any land.");
      if(
IsPlayerInGangZone(playeridLandInfo[x][landZone]))
      return 
SendClientMessage(playeridCOLOR_GREY"You are in your land.");
         else 
SendClientMessage(playeridCOLOR_GREY"You are not in your land.");
         {
               if(
strcmp(playernameLandInfo[x][landOwner], true) == 0)
            {
                
editingLand[playerid] = x;
                break;
            }
            else
            {
                
editingLand[playerid] = -1;
            }
        }
    }
    
ShowPlayerDialogEx(playeridLANDSMAIN,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(playeridLANDSMAIN,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]