SA-MP Forums Archive
problem, help me - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: problem, help me (/showthread.php?tid=102528)



problem, help me - Pinehole - 16.10.2009

I have this code, i'm trying to make it that i have to be level 1 admin to to use /bush i think it's something wrong with my brackets help, when ever i compile it i get over 26 errors.

here is the pAdmin code
Код:
if(pAdmin[playerid] >= 1)
{
Код:
//--------------------[bush]-----------------------------

		if ( !strcmp( "/bush", cmdtext, true ) )
		{
		  tmp = strtok(cmdtext, idx);
          if(!strlen(tmp))
      

		
				if ( BushEnabled[playerid] )
				{
				

					DestroyObject( BushObject[playerid] );
 			 		SendClientMessage(playerid, 0xDEEE20FF, "The Bush is Disabled.");
					BushEnabled[playerid] = false;
		  			return 1;
 				}
 				
 				  if(pAdmin[playerid] >= 1)
{
					BushObject [playerid] = CreateObject( 800, 0, 0, 0, 0, 0, 0 );
					BushEnabled[playerid] = true;
  			  SendClientMessage(playerid, 0xDEEE20FF, "The Bush is Enabled.");
					AttachObjectToPlayer( BushObject[playerid], playerid, 0, 0, 0, 0, 0, 0 );
					return 1;
		}



Re: problem, help me - Pinehole - 16.10.2009

help?


Re: problem, help me - vafapoor - 16.10.2009

heh well double postin aint gonna get ya no help

btw heres a link to your answer : http://www.cluckinbellhappychicken.com


Re: problem, help me - Pinehole - 16.10.2009

That doesn't solve my problem at all, that's just a link of something that has nothing to do with my question.


Re: problem, help me - Pghpunkid - 16.10.2009

pawn Код:
//--------------------[bush]-----------------------------

if ( !strcmp( "/bush", cmdtext, true ) )
{
  tmp = strtok(cmdtext, idx);
  if(!strlen(tmp))
  {    
    if ( BushEnabled[playerid] )
    {
      DestroyObject( BushObject[playerid] );
      SendClientMessage(playerid, 0xDEEE20FF, "The Bush is Disabled.");
      BushEnabled[playerid] = false;
      return 1;
    }
               
    if(pAdmin[playerid] >= 1)
    {
      BushObject [playerid] = CreateObject( 800, 0, 0, 0, 0, 0, 0 );
      BushEnabled[playerid] = true;
      SendClientMessage(playerid, 0xDEEE20FF, "The Bush is Enabled.");
      AttachObjectToPlayer( BushObject[playerid], playerid, 0, 0, 0, 0, 0, 0 );
      return 1;
    }
  }
}
Your welcome.


Re: problem, help me - Pinehole - 16.10.2009

Thanks, but what's the code or how to make when a player logs it saves there money, when a player logs in it saves there money, same things with guns, and skins.


Re: problem, help me - Pghpunkid - 16.10.2009

Look up fopen, fclose, fread, fwrite, dini, dudb. These are all ways of saving/loading data. there are an unlimited amount of pre-existing scripts in the Showroom that you can download and learn from as well.


Re: problem, help me - Peter_Corneile - 16.10.2009

pawn Код:
//--------------------[bush]-----------------------------

        if ( strcmp( "/bush", cmdtext, true,5 ) )
        {
          tmp = strtok(cmdtext, idx);
          if(!strlen(tmp))
          {
         
          return 1;
          }
     

       
                if ( BushEnabled[playerid] )
                {
               

                    DestroyObject( BushObject[playerid] );
                    SendClientMessage(playerid, 0xDEEE20FF, "The Bush is Disabled.");
                    BushEnabled[playerid] = false;
                    return 1;
                }
               
                  if(pAdmin[playerid] >= 1)
{
                    BushObject [playerid] = CreateObject( 800, 0, 0, 0, 0, 0, 0 );
                    BushEnabled[playerid] = true;
              SendClientMessage(playerid, 0xDEEE20FF, "The Bush is Enabled.");
                    AttachObjectToPlayer( BushObject[playerid], playerid, 0, 0, 0, 0, 0, 0 );
}
return 1;
}



Re: problem, help me - Pghpunkid - 17.10.2009

Quote:
Originally Posted by ►Peter Corneile◄ [hugu-hosting.co.uk
]
pawn Код:
//--------------------[bush]-----------------------------

        if ( strcmp( "/bush", cmdtext, true,5 ) )
        {
          tmp = strtok(cmdtext, idx);
          if(!strlen(tmp))
          {
         
          return 1;
          }
     

       
                if ( BushEnabled[playerid] )
                {
               

                    DestroyObject( BushObject[playerid] );
                    SendClientMessage(playerid, 0xDEEE20FF, "The Bush is Disabled.");
                    BushEnabled[playerid] = false;
                    return 1;
                }
               
                  if(pAdmin[playerid] >= 1)
{
                    BushObject [playerid] = CreateObject( 800, 0, 0, 0, 0, 0, 0 );
                    BushEnabled[playerid] = true;
              SendClientMessage(playerid, 0xDEEE20FF, "The Bush is Enabled.");
                    AttachObjectToPlayer( BushObject[playerid], playerid, 0, 0, 0, 0, 0, 0 );
}
return 1;
}
If you would have read, that was already solved..