SA-MP Forums Archive
Help with this - 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 with this (/showthread.php?tid=374873)



Help with this - RyanPetersons - 04.09.2012

pawn Код:
CMD:setrpmarks(playerid,params[])
{
new otherid;
new pname[140];
new othername[140];
new inputtext[140];
new rpmarks[10];
GetPlayerName(playerid,pname,sizeof(pname));
GetPlayerName(playerid,othername,sizeof(othername));
if(sscanf(params, "u", otherid, pInfo[playerid][rpmarks])) return SendClientMessage(playerid, White, "USAGE: /setrpmarks [playerid] [marks]");
pInfo[otherid][rpmarks] = rpmarks;
format(string,sizeof(string),"RolePlay Teacher %s has setted your roleplay marks %d",pname,rpmarks);
SendClientMessage(otherid,Yellow,string);
format(string,sizeof(string),"You've setted %s roleplay marks to %d",othername,rpmarks);
SendClientMessage(otherid,Yellow,string);
return 1;
}
When i set it to any digit, it displays that you've setted the player's 17 rpmarks.
even, i set it to 10 or it to any digit
pleaze, fix this problem if you guys can.
i hope, its easy to fix for you guys.


Re: Help with this - RyanPetersons - 04.09.2012

Someone pleaze help me faster in this.


Re: Help with this - FalconX - 04.09.2012

pawn Код:
CMD:setrpmarks( playerid,params[ ] )
{
    new targetid, rpmarks, szName[ 24 ], szOtherName[ 24 ], szStr[ 128 ];
   
    GetPlayerName( playerid,szName,sizeof( szName ) );
   
    if( sscanf( params, "ud", targetid, rpmarks ) ) return SendClientMessage( playerid, White, "USAGE: /setrpmarks [playerid] [marks]" );

    GetPlayerName( targetid, szOtherName, sizeof( szOtherName ) );
   
    pInfo[ targetid ][ rpmarks ] = rpmarks;
   
    format( szStr, sizeof( szStr ), "RolePlay Teacher %s has setted your roleplay marks %d", szName, rpmarks );
    SendClientMessage( targetid, Yellow, szStr );
   
    format( szStr, sizeof( szStr ), "You've setted %s roleplay marks to %d", szOtherName, rpmarks );
    SendClientMessage( playerid, Yellow, szStr );
    return 1;
}
This is what I re-wrote as your code was totally wrong and it was bugged And next to that, don't use "140" because if the arrays become higher and they are not used it will probably make your server lag (afaik) and to let you know the max player name in the server is not more then "24".

Hope this helps.


Re: Help with this - RyanPetersons - 04.09.2012

still same..


Re: Help with this - FalconX - 04.09.2012

Quote:
Originally Posted by RyanPetersons
Посмотреть сообщение
still same..
What are the errors!?


Re: Help with this - RyanPetersons - 04.09.2012

none