SA-MP Forums Archive
Weapon Skills command. [REP+] - 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: Weapon Skills command. [REP+] (/showthread.php?tid=294026)



Weapon Skills command. [REP+] - GangsTa_ - 30.10.2011

Hey. I've made a weapon skills command. But when I type it nothing happens.
Here's the command:

pawn Код:
else if(strcmp(cmd, "/myskill", true) == 0)
{
    new skillstring[1000];
    new points[6];
    points[0] = 100 - PlayerInfo[playerid][pSDPistol];
    points[1] = 100 - PlayerInfo[playerid][pDesertEagle];
    points[2] = 100 - PlayerInfo[playerid][pShotGun];
    points[3] = 100 - PlayerInfo[playerid][pMP5];
    points[4] = 100 - PlayerInfo[playerid][pAK47];
    points[5] = 100 - PlayerInfo[playerid][pM4];
    format(skillstring,1000,"SDPistol:\t[%s]%d%\nDeagle:\t[%s]%d%\nShotGun:\t[%s]%d%\nMP5\t\t[%s]%d%\nAK47:\t\t[%s]%d%\nM4A1:\t\t[%s]%d%",
    ToDevelopSkills(PlayerInfo[playerid][pSDPistol],points[0]),PlayerInfo[playerid][pSDPistol],
    ToDevelopSkills(PlayerInfo[playerid][pDesertEagle],points[1]),PlayerInfo[playerid][pDesertEagle],
    ToDevelopSkills(PlayerInfo[playerid][pShotGun],points[2]),PlayerInfo[playerid][pShotGun],
    ToDevelopSkills(PlayerInfo[playerid][pMP5],points[3]),PlayerInfo[playerid][pMP5],
    ToDevelopSkills(PlayerInfo[playerid][pAK47],points[4]),PlayerInfo[playerid][pAK47],
    ToDevelopSkills(PlayerInfo[playerid][pM4],points[5]),PlayerInfo[playerid][pM4]);
    ShowPlayerDialog(playerid,435343,DIALOG_STYLE_MSGBOX,"<< Weapon Skills >>",skillstring,"Done","");
    return 1;
}



Re: Weapon Skills command. [REP+] - sleepysnowflake - 30.10.2011

Why would you do ELSE if ? You could od just if. the string might be wayyy too big. try lower down ?


Re: Weapon Skills command. [REP+] - GangsTa_ - 30.10.2011

What size do you recommand?


Re: Weapon Skills command. [REP+] - sleepysnowflake - 30.10.2011

What about 258 ? Is it too less ? Test around. You can never do anything without testing.

You can always do a printf(yourstring) to see where the problem is.


Re: Weapon Skills command. [REP+] - GangsTa_ - 30.10.2011

Good idea.


Re: Weapon Skills command. [REP+] - GangsTa_ - 30.10.2011

I had just to change the dialog ID because it was too big.