ID's Problem
#1

Hello I am Using RP Gamemode in server,But its kinda bug when i do /gotoid 0 it tele me to id 9 .
And if i try /setvip 4-5-6 it always set to ID 0,Can any 1 help wat is that?
Reply
#2

show us your command. the strcmp(blablabla)...
is it a coincidence that the "/gotoid 0" got a stringlenght of 9? i guess so...
btw in advance: have a look at ZCMD and sscanf2 here...
ZCMD: http://forum.sa-mp.com/showthread.ph...ight=zeex+zcmd
sscanf2: https://sampforum.blast.hk/showthread.php?tid=120356
Reply
#3

It's a sscanf problem, had the same tho

Make sure you are using the right sscanf version

example - Use the latest sscanf plugin and 0.3d R5 Server Version
Reply
#4

until sscanf2 gets fixed to work with future versions, my suggstion is to stick to the "d" instead the "u" as TargetID. my old code in the gamemode looks like
Код:
CMD:goto(playerid,params[]){
	new TargetID;
	if (sscanf(params,"u",TargetID))
... this fails atm, due to the sscanf returns 0 as TargetID always.
copy your command, and apply the simple change:
Код:
CMD:goto(playerid,params[]){
	new TargetID;
	if (sscanf(params,"d",TargetID))
... then paste it in a filterscript. a filterscript command will bypass your gamemode command, so your gamemode command is safe, but not used anymore, as long the filterscript is loaded. iam using this trick for all commands (using a "d",TargetID).
as soon an update for sscanf2 is available, i only need to unload (remove from server.cfg) the commands filterscipt.
Reply
#5

Here is /gotoid , /gethere www.pastebin.com/HmkkxiXy.
Using Serverffs for host, audio.so,streamer.so,sscanf.so
In Pawno sscanf2,please help me to fix this.
Reply
#6

ah, i guessed the reason already:
the sscanf2 plugin works great with 0.3c, it can retrieve the playerid from the players name. however, since some updates to SAMP changed the memory offsets for playernames, where the player ids are stored, the sscanf2 gets tricked, and kind of forced to push out wrong values. this is caused by using the "u" parameter, which handles the playername-to-numerical conversion.
to fix all your commands for now, the best way is to stick to the "d" parameter instead of "u". its not parsing a playername like /goto bab (bab becomes my id, like id 9), so you would need to directly type /goto 9.
in short:
change all your "u" into a "d" in all sscanf prarameter strings:
search for each "sscan" and manually seek any "u" inside the brackets, like "u", "ud", "uu", "uud", and replace each "u" with a "d". the 4 strings above would change to "d" "dd" "dd" and "ddd". looks weird, but you can depend that all your changed commands will work for now, despite they take numerical values only.
as soon a final release of SAMP 0.3d (R1 most prolly) got released, give ****** some days to redem his plugin, and as soon this happened, we will be able to convert all or commands back....
here your 2 commands starting lines each: pay attention, there arent any "u" inside:
Код:
CMD:gotoid(playerid, params[])
{
        new giveplayerid;
        if(sscanf(params, "d", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /gotoid [playerid]");
Код:
CMD:gethere(playerid, params[])
{
        new giveplayerid;
        if(sscanf(params, "d", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /gethere [playerid]");
iam sure you will find more commands you didnt use yet, have fun fixing all of them ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)