Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Usage of variable

$
0
0
hello all today i wrote a simple anti weapon hack sctript that fits my servers variables but i have a simple problem that my mind cant accept.

this is my script and apparently i cant use asd in it becuase its a string and tell me that i need to index it:

Code:

public wepcheat(playerid)
{
        new say1[MAX_PLAYERS],say2[MAX_PLAYERS];
        for(new ii=0; ii<MAX_PLAYERS;ii++)
        {
                for(new i=1; i < 3; i++)
                {
                    new asd[15];
                        format(asd,sizeof(asd),"[GUN%d]",i);
                    if(USER[ii]asd!=0)
                        {
                            say1[ii]++;
                        }
                }
                for(new aa=0; aa<12; aa++)
                {
                        new wid,wam;
                        GetPlayerWeaponData(ii,aa,wid,wam);
                        if(wid!=0)
                        {
                            say2[ii]++;
                        }
                       
                }
                if(say1[ii]!=say2[ii])
                {
                    new rcontext[40],bantext[128];
                    format(bantext,sizeof(bantext),"ADMCMD-AUTOBAN: %s has been banned. Reason: Weapon hacks.");
                        SendClientMessageToAll(COLOR_RED,bantext);
                    format(rcontext,sizeof(rcontext),"ban %d",ii);
                    SendRconCommand(rcontext);
                }
        }
}

any help is appreciated

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>