SA-MP Forums Archive
[HELP] Always scans ID 0... - 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)
+--- Thread: [HELP] Always scans ID 0... (/showthread.php?tid=311117)



[HELP] Always scans ID 0... - Type-R - 15.01.2012

Hello i made this little rank system, and i cannot make this command so that everyone could check each others stats. No matter what ID i type in, it will always show ID 0 of a player... :/ Here's the script:

pawn Код:
dcmd_rank( playerid, params[] )
{
    new zid;
    if(sscanf(params, "u", zid)) return SendClientMessage(playerid,0x00FF00AA, "{FBDF89}[FunZoneLT]>> /rank [zaidejoid]");

    if(!IsPlayerConnected(zid)) return SendClientMessage(playerid, raudona, "[FunZoneLT]>> Tokio zaidejo nera.");
    new str[256];
    if(Kills[zid]<10)
    {
        format(str,sizeof(str),"{F81414}[FunZoneLT]>> {6EF83C}Lygis: {FFAF00}1 {6EF83C}| Nuzudymai: {FFAF00}%d {6EF83C}| Mirtys: {FFAF00}%d",GetPlayerKills(zid),GetPlayerDeaths(zid));
        SendClientMessage(playerid,0x00FF00AA,str);
    }
    else if(Kills[zid]>10 && Kills[zid]<=75)
    {
        format(str,sizeof(str),"{F81414}[FunZoneLT]>> {6EF83C}Lygis: {FFAF00}2 {6EF83C}| Nuzudymai: {FFAF00}%d {6EF83C}| Mirtys: {FFAF00}%d",GetPlayerKills(zid),GetPlayerDeaths(zid));
        SendClientMessage(playerid,0x00FF00AA,str);
    }
    else if(Kills[zid]>75 && Kills[zid]<=150)
    {
        format(str,sizeof(str),"{F81414}[FunZoneLT]>> {6EF83C}Lygis: {FFAF00}3 {6EF83C}| Nuzudymai: {FFAF00}%d {6EF83C}| Mirtys: {FFAF00}%d",GetPlayerKills(zid),GetPlayerDeaths(zid));
        SendClientMessage(playerid,0x00FF00AA,str);
    }
    else if(Kills[zid]>150 && Kills[zid]<=300)
    {
        format(str,sizeof(str),"{F81414}[FunZoneLT]>> {6EF83C}Lygis: {FFAF00}4 {6EF83C}| Nuzudymai: {FFAF00}%d {6EF83C}| Mirtys: {FFAF00}%d",GetPlayerKills(zid),GetPlayerDeaths(zid));
        SendClientMessage(playerid,0x00FF00AA,str);
    }
    else if(Kills[zid]>300 && Kills[zid]<=450)
    {
        format(str,sizeof(str),"{F81414}[FunZoneLT]>> {6EF83C}Lygis: {FFAF00}5 {6EF83C}| Nuzudymai: {FFAF00}%d {6EF83C}| Mirtys: {FFAF00}%d",GetPlayerKills(zid),GetPlayerDeaths(zid));
        SendClientMessage(playerid,0x00FF00AA,str);
    }
    else if(Kills[zid]>450 && Kills[zid]<= 675)
    {
        format(str,sizeof(str),"{F81414}[FunZoneLT]>> {6EF83C}Lygis: {FFAF00}6 {6EF83C}| Nuzudymai: {FFAF00}%d {6EF83C}| Mirtys: {FFAF00}%d",GetPlayerKills(zid),GetPlayerDeaths(zid));
        SendClientMessage(playerid,0x00FF00AA,str);
    }
    else if(Kills[zid]>675 && Kills[zid]<= 1000)
    {
        format(str,sizeof(str),"{F81414}[FunZoneLT]>> {6EF83C}Lygis: {FFAF00}7 {6EF83C}| Nuzudymai: {FFAF00}%d {6EF83C}| Mirtys: {FFAF00}%d",GetPlayerKills(zid),GetPlayerDeaths(zid));
        SendClientMessage(playerid,0x00FF00AA,str);
    }
    else if(Kills[zid]>1000 && Kills[zid]<= 1500)
    {
        format(str,sizeof(str),"{F81414}[FunZoneLT]>> {6EF83C}Lygis: {FFAF00}8 {6EF83C}| Nuzudymai: {FFAF00}%d {6EF83C}| Mirtys: {FFAF00}%d",GetPlayerKills(zid),GetPlayerDeaths(zid));
        SendClientMessage(playerid,0x00FF00AA,str);
    }
    else if(Kills[zid]>1500 && Kills[zid]<= 2250)
    {
        format(str,sizeof(str),"{F81414}[FunZoneLT]>> {6EF83C}Lygis: {FFAF00}9 {6EF83C}| Nuzudymai: {FFAF00}%d {6EF83C}| Mirtys: {FFAF00}%d",GetPlayerKills(zid),GetPlayerDeaths(zid));
        SendClientMessage(playerid,0x00FF00AA,str);
    }
    else if(Kills[zid]>2250 && Kills[zid]<= 3375)
    {
        format(str,sizeof(str),"{F81414}[FunZoneLT]>> {6EF83C}Lygis: {FFAF00}10 {6EF83C}| Nuzudymai: {FFAF00}%d {6EF83C}| Mirtys: {FFAF00}%d",GetPlayerKills(zid),GetPlayerDeaths(zid));
        SendClientMessage(playerid,0x00FF00AA,str);
    }
    else if(Kills[zid]>3375 && Kills[zid]<= 5100)
    {
        format(str,sizeof(str),"{F81414}[FunZoneLT]>> {6EF83C}Lygis: {FFAF00}11 {6EF83C}| Nuzudymai: {FFAF00}%d {6EF83C}| Mirtys: {FFAF00}%d",GetPlayerKills(zid),GetPlayerDeaths(zid));
        SendClientMessage(playerid,0x00FF00AA,str);
    }
    else if(Kills[zid]>5100 && Kills[zid]<= 7650)
    {
        format(str,sizeof(str),"{F81414}[FunZoneLT]>> {6EF83C}Lygis: {FFAF00}12 {6EF83C}| Nuzudymai: {FFAF00}%d {6EF83C}| Mirtys: {FFAF00}%d",GetPlayerKills(zid),GetPlayerDeaths(zid));
        SendClientMessage(playerid,0x00FF00AA,str);
    }
    else if(Kills[zid]>7650 && Kills[zid]<= 11475)
    {
        format(str,sizeof(str),"{F81414}[FunZoneLT]>> {6EF83C}Lygis: {FFAF00}13 {6EF83C}| Nuzudymai: {FFAF00}%d {6EF83C}| Mirtys: {FFAF00}%d",GetPlayerKills(zid),GetPlayerDeaths(zid));
        SendClientMessage(playerid,0x00FF00AA,str);
    }
    else if(Kills[zid]>11475 && Kills[zid]<= 17500)
    {
        format(str,sizeof(str),"{F81414}[FunZoneLT]>> {6EF83C}Lygis: {FFAF00}14 {6EF83C}| Nuzudymai: {FFAF00}%d {6EF83C}| Mirtys: {FFAF00}%d",GetPlayerKills(zid),GetPlayerDeaths(zid));
        SendClientMessage(playerid,0x00FF00AA,str);
    }
    else if(Kills[zid]>17500 && Kills[zid]<= 26250)
    {
        format(str,sizeof(str),"{F81414}[FunZoneLT]>> {6EF83C}Lygis: {FFAF00}15 {6EF83C}| Nuzudymai: {FFAF00}%d {6EF83C}| Mirtys: {FFAF00}%d",GetPlayerKills(zid),GetPlayerDeaths(zid));
        SendClientMessage(playerid,0x00FF00AA,str);
    }
    else if(Kills[zid]>26250 && Kills[zid]<= 39375)
    {
        format(str,sizeof(str),"{F81414}[FunZoneLT]>> {6EF83C}Lygis: {FFAF00}16 {6EF83C}| Nuzudymai: {FFAF00}%d {6EF83C}| Mirtys: {FFAF00}%d",GetPlayerKills(zid),GetPlayerDeaths(zid));
        SendClientMessage(playerid,0x00FF00AA,str);
    }
    else if(Kills[zid]>39375 && Kills[zid]<= 60000)
    {
        format(str,sizeof(str),"{F81414}[FunZoneLT]>> {6EF83C}Lygis: {FFAF00}17 {6EF83C}| Nuzudymai: {FFAF00}%d {6EF83C}| Mirtys: {FFAF00}%d",GetPlayerKills(zid),GetPlayerDeaths(zid));
        SendClientMessage(playerid,0x00FF00AA,str);
    }
    else if(Kills[zid]>60000 && Kills[zid]<= 100000)
    {
        format(str,sizeof(str),"{F81414}[FunZoneLT]>> {6EF83C}Lygis: {FFAF00}18 {6EF83C}| Nuzudymai: {FFAF00}%d {6EF83C}| Mirtys: {FFAF00}%d",GetPlayerKills(zid),GetPlayerDeaths(zid));
        SendClientMessage(playerid,0x00FF00AA,str);
    }
    else if(Kills[zid]> 100000)
    {
        format(str,sizeof(str),"{F81414}[FunZoneLT]>> {6EF83C}Lygis: {FFAF00}19 {6EF83C}| Nuzudymai: {FFAF00}%d {6EF83C}| Mirtys: {FFAF00}%d",GetPlayerKills(zid),GetPlayerDeaths(zid));
        SendClientMessage(playerid,0x00FF00AA,str);
    }
    return 1;
}
Anyone know what the problem is?


Re: [HELP] Always scans ID 0... - JamesC - 15.01.2012

Update sscanf and / or your SA-MP server to the latest versions.


Re: [HELP] Always scans ID 0... - Mean - 15.01.2012

Quote:
Originally Posted by JamesC
Посмотреть сообщение
Update sscanf and / or your SA-MP server to the latest versions.
This. You're using the sscanf plugin for 0.3c. Click here to download the newest sscanf.