SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 13/07/2019, 12:21 AM   #1
RainbowAsher
Little Clucker
 
Join Date: Jul 2015
Posts: 9
Reputation: 0
Default What is avar

Hello guys. So I got this gamemode on the internet and it has a thing called [avar][number] and I dont actually understand what is it and how to use it. Thanks
PHP Code:
CMD:spray(playeridparams [])
{
    if(
pInfo[playerid][pClan] == -1) return SendClientMessage(playeridCOLOR_DARKGRAY"You're not part of a clan.");
    if(
pInfo[playerid][pCRank] < 3) return SendClientMessage(playeridCOLOR_DARKGRAY"You not have minimum rank 3.");
    if(
GetPlayerWeapon(playerid) != 41) return SendClientMessage(playeridCOLOR_DARKGRAY"You don't have a Spray in hand.");
    if(
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playeridCOLOR_DARKGRAY"You can't use this command from inside a vehicle.");
    if(
vwp[playerid] != 0) return SendClientMessage(playeridCOLOR_DARKGRAY"You're not in Virtual-World 0.");
    
pInfo[playerid][aVar][88] = 0;
    for(new 
0sizeof(CWar); h++) if(IsPlayerInRangeOfPoint(playerid2.8CWar[h][Posw][0], CWar[h][Posw][1], CWar[h][Posw][2]))
    {
        if(
CWar[h][ClanOwn] == pInfo[playerid][pClan]) return SendClientMessage(playeridCOLOR_DARKGRAY"You can not spray your own wall.");
        if(
CWar[h][NAttack] > gtm) return SendClientMessage(playeridCOLOR_DARKGRAY"This wall can not be sprayed at this time.");
        if(
CWar[h][AttOn] == 1) return SendClientMessage(playeridCOLOR_DARKGRAY"A wall already spraying.");
        if(
pInfo[playerid][aVar][111] < gtmpInfo[playerid][aVar][112] = 0pInfo[playerid][aVar][43] = -1;
        
ApplyAnimation(playerid,"SPRAYCAN","spraycan_full",4.1,1,0,1,0,0);
        switch(
pInfo[playerid][aVar][112])
        {
            case 
0:
            {
                
GameTextForPlayer(playerid"~n~~n~~n~~n~~n~~n~~n~~w~spraying...~n~1/10"100003), pInfo[playerid][aVar][43] = h;
                
format(stmsg[playerid], 189"((Clan War)): %s a inceput sa spray-eze pe peretele #%d detinut de Clanul {%s}%s{77D45F}."GetName(playerid), h+1Clan[CWar[h][ClanOwn]][Color], Clan[CWar[h][ClanOwn]][Name]), SendClanMessage(pInfo[playerid][pClan], 0x77D45FFFstmsg[playerid]);
                
format(stmsg[playerid], 210"((Clan War)): Clanul {%s}%s {77D45F}a inceput sa spray-eze peretele #%d detinut de Clanul tau, mergi si omoara adversarul care spray-aza peretele. (/walls)"Clan[pInfo[playerid][pClan]][Color], Clan[pInfo[playerid][pClan]][Name], h+1), SendClanMessage(CWar[h][ClanOwn], 0x77D45FFFstmsg[playerid]);
            }
            case 
1GameTextForPlayer(playerid"~n~~n~~n~~n~~n~~n~~n~~w~spraying...~n~2/10"100003);
            case 
2GameTextForPlayer(playerid"~n~~n~~n~~n~~n~~n~~n~~w~spraying...~n~3/10"100003);
            case 
3GameTextForPlayer(playerid"~n~~n~~n~~n~~n~~n~~n~~w~spraying...~n~4/10"100003);
            case 
4GameTextForPlayer(playerid"~n~~n~~n~~n~~n~~n~~n~~w~spraying...~n~5/10"100003);
            case 
5GameTextForPlayer(playerid"~n~~n~~n~~n~~n~~n~~n~~w~spraying...~n~6/10"100003);
            case 
6GameTextForPlayer(playerid"~n~~n~~n~~n~~n~~n~~n~~w~spraying...~n~7/10"100003);
            case 
7GameTextForPlayer(playerid"~n~~n~~n~~n~~n~~n~~n~~w~spraying...~n~8/10"100003);
            case 
8GameTextForPlayer(playerid"~n~~n~~n~~n~~n~~n~~n~~w~spraying...~n~9/10"100003);
            case 
9GameTextForPlayer(playerid"~n~~n~~n~~n~~n~~n~~n~~w~spraying...~n~10/10"100003);
        }
        
pInfo[playerid][aVar][25] = SetTimerEx("GeneralTimer"10000false"ii"playerid29), pInfo[playerid][aVar][88] = 1pInfo[playerid][aVar][111] = gtm+120CWar[h][AttOn] = 1;
        return 
1;
    }
    if(
pInfo[playerid][aVar][88] == 0) return SendClientMessage(playeridCOLOR_DARKGRAY"You are not at the any walls for spraying, use /walls.");
    return 
1;

https://ibb.co/YPtDg03
https://ibb.co/9cGV3qw
RainbowAsher is offline   Reply With Quote
Old 13/07/2019, 01:23 AM   #2
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,191
Reputation: 386
Default Re: What is avar

Whoever uses 3 dimensional arrays like that without having the second variable a string is just fucking stupid tbh, you'll never know what it's used for because whoever made that just used every cell in it assigned to something, cell 25 is a timer, cell 88 is obviously a boolean for being near a wall, cell 111 is something related to this gtm thing which i have no idea what it is because you didn't show the full code, cell 112 is probably something that defines the spraying type or whatever.

It's a stupid concept and that's why you should create your own gamemode or use one that was made by someone who doesn't use his ass to think instead of his brain, okay, tyvm.
__________________
Quote:
Originally Posted by Andy
I offer paid scripting services, I can do anything except mapping because fuck mapping.

[Github]:Link [Gists]:Link [Forum]:Link [Server]:Link [Discord]:Link


RogueDrifter is offline   Reply With Quote
Old 13/07/2019, 08:52 AM   #3
KeyOfKey
Huge Clucker
 
KeyOfKey's Avatar
 
Join Date: Apr 2019
Posts: 239
Reputation: 12
Default Re: What is avar

Totally agree with RogueDrifter. What the hell is avar, gtm, 111 and some other random numbers? It's so hard to give variables a human readable name? It's so damn hard? How the hell can you even recognize something like that when scripting? This is so fuckin stupid and useless.
KeyOfKey is online now   Reply With Quote
Old 13/07/2019, 09:14 PM   #4
RainbowAsher
Little Clucker
 
Join Date: Jul 2015
Posts: 9
Reputation: 0
Default Re: What is avar

Ye, I agree with you guys. I tried to figure it out but I still didn't understand what is it. This gamemode is cool but the way he make it is horrible.
RainbowAsher is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 10:19 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.