How to call a function? (+Rep for help)
#1

pawn Код:
forward EndAntiSpawnKill(playerid);
public EndAntiSpawnKill(playerid)
{
        format(Vnewban,32,BanDir,VBPlayer(playerid));
        VBanLoadInfo(playerid,Vnewban);
        new name[MAX_PLAYER_NAME+1];
        GetPlayerName(playerid, name, sizeof(name));
        new string[264];
        new ip[16];
        GetPlayerIp(playerid, ip, sizeof(ip));
        format(string, sizeof(string), "%s [ID: %d] [IP: %s] is suspected of ban evading. (Old Name: %s)", name, playerid, ip, dini_Get(Vnewban,"Nick")); //I want it to show up the old name
        MessageToAdmins(0xFD01FDAA,string);
        printf(string);

       
}
stock VBanLoadInfo(playerid,Varq[]) //Varq is the variable how can I call it up there?
{
    if(!dini_Exists(Varq))
        return SendClientMessage(playerid, -1,"NOTE: No Banned Found!");

    new Str[300];
    new Str1[300];
    new Str2[300];
    new Str3[300];
    new Str4[300];
    new Str5[300];
    format(Str,300,"Nickname: %s",dini_Get(Varq,"Nick")); //get this on top
    format(Str1,300,"IP: %s",dini_Get(Varq,"IP"));
    format(Str2,300,"Admin: %s",dini_Get(Varq,"Admin"));
    format(Str3,300,"Reason: %s",dini_Get(Varq,"Reason"));
    format(Str4,300,"Date: %s",dini_Get(Varq,"Date"));
    format(Str5,300,"Hour: %s",dini_Get(Varq,"Hour"));

    MessageToAdmins(red,Str);
    MessageToAdmins(red,Str1);
    MessageToAdmins(red,Str2);
    MessageToAdmins(red,Str3);
    MessageToAdmins(red,Str4);
    MessageToAdmins(red,Str5);
    return 1;
}
Its basically showing the message, but it wont show up the old name, I dont know how to call it, please help.
Reply
#2

what is the varq?
Reply
#3

pawn Код:
stock VBanLoadInfo(playerid,Varq[])
That would be the target player (Ban Evader)
Reply
#4

https://sampwiki.blast.hk/wiki/CallLocalFunction
Reply
#5

Example please?
Reply
#6

pawn Код:
forward EndAntiSpawnKill(playerid);
public EndAntiSpawnKill(playerid)
{
        format(Vnewban,32,BanDir,VBPlayer(playerid));
        VBanLoadInfo(playerid,Vnewban);
        new name[MAX_PLAYER_NAME+1];
        GetPlayerName(playerid, name, sizeof(name));
        new string[264];
        new ip[16];
        GetPlayerIp(playerid, ip, sizeof(ip));
        format(string, sizeof(string), "%s [ID: %d] [IP: %s] is suspected of ban evading. (Old Name: %s)", name, playerid, ip, dini_Get(Vnewban,"Nick")); //I want it to show up the old name
        MessageToAdmins(0xFD01FDAA,string);
        printf(string);
        VBanLoadInfo(playerid);//notice I changed it to just playerid
       
}
Some things are wrong in the stock as well...
pawn Код:
stock VBanLoadInfo(Varq) //Varq is the id of the player
{
    if(!dini_Exists(Varq))
    return MessageToAdmins(red, "No Banned Found!");//changed to adminmessage

    new Str[300];
    new Str1[300];
    new Str2[300];
    new Str3[300];
    new Str4[300];
    new Str5[300];
    format(Str,300,"Nickname: %s",dini_Get(Varq,"Nick")); //get this on top
    format(Str1,300,"IP: %s",dini_Get(Varq,"IP"));
    format(Str2,300,"Admin: %s",dini_Get(Varq,"Admin"));
    format(Str3,300,"Reason: %s",dini_Get(Varq,"Reason"));
    format(Str4,300,"Date: %s",dini_Get(Varq,"Date"));
    format(Str5,300,"Hour: %s",dini_Get(Varq,"Hour"));

    MessageToAdmins(red,Str);
    MessageToAdmins(red,Str1);
    MessageToAdmins(red,Str2);
    MessageToAdmins(red,Str3);
    MessageToAdmins(red,Str4);
    MessageToAdmins(red,Str5);
    return 1;
}
try that
Reply
#7

Not working.
I just want this to show up the old name (The one he got banned with)

pawn Код:
format(Str,300,"Nickname: %s",dini_Get(Varq,"Nick"));
Which is that.
Reply
#8

oh shit, sorry, I didn't see that...The best way would be to use a command...Ignore what I said above :P

pawn Код:
CMD:checkban(playerid, params[])
    {
    new varq[MAX_PLAYER_NAME];
    if(sscanf(params, "s", varq)) return SendClientMessage(playerid, -1, "Usage: /checkban [name]");
    VBanLoadInfo(playerid, varq);
    return 1;
    }
Reply
#9

pawn Код:
forward EndAntiSpawnKill(playerid);
public EndAntiSpawnKill(playerid)
{
        format(Vnewban,32,BanDir,VBPlayer(playerid)); //VBPlayer has to be a string for this to work.
        //EDIT: What is 'BanDir' and what is 'VBPlayer' and 'Vnewban'.
        VBanLoadInfo(playerid,Vnewban);
        new name[MAX_PLAYER_NAME+1];
        GetPlayerName(playerid, name, sizeof(name));
        new string[264];
        new ip[16];
        GetPlayerIp(playerid, ip, sizeof(ip));
        format(string, sizeof(string), "%s [ID: %d] [IP: %s] is suspected of ban evading. (Old Name: %s)", name, playerid, ip, dini_Get(Vnewban,"Nick")); //I want it to show up the old name
        MessageToAdmins(0xFD01FDAA,string);
        printf(string);
}
Reply
#10

Not working
Reply


Forum Jump:


Users browsing this thread: 10 Guest(s)