problem, help me
#1

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;
		}
Reply
#2

help?
Reply
#3

heh well double postin aint gonna get ya no help

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

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

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.
Reply
#6

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.
Reply
#7

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.
Reply
#8

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;
}
Reply
#9

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..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)