SA-MP Forums Archive
Need Help [Error 035] [+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: Need Help [Error 035] [+REP] (/showthread.php?tid=628200)



Need Help [Error 035] [+REP] - LondonRP - 07.02.2017

Quote:

COMMAND:createteleport(playerid, params[])
{
if(PlayerInfo[playerid][power] < 9) return SendClientError(playerid, CANT_USE_CMD);
new tpNames;
new hid=ReturnNextUnusedTeleport();
if(sscanf(params, "sz", hid ,tpNames)) return SCP(playerid, "[Faction ID] [Teleport Name]");
// if( sscanf ( params, "d", id)) return SCP(playerid, "[FACTION ID / 255 civ]");
SendClientMSG(playerid,COLOR_GREY, "Teleport [ID: %d] [Teleport Name: %s].",hid,tpNames);
new hf[64];
new Float: X, Float: Y, Float: Z;
new blazer = GetPlayerInterior(playerid);
new giordino = GetPlayerVirtualWorld(playerid);
GetPlayerPos(playerid,X,Y,Z);
format(hf,sizeof(hf),"teleports/teleport%d.txt",hid);
if(!dini_Exists(hf))
{
dini_Create(hf);
dini_Set(hid,"tpName", tpNames); // line "20815"
myStrcpy(biz[hid][tpName],tpNames); // line "20816"
dini_IntSet(hf,"teleportid",hid);
dini_IntSet(hf,"startinterior",blazer);
dini_IntSet(hf,"startvirtualworld",giordino);
dini_IntSet(hf,"endtvirtualworld",0);
dini_IntSet(hf,"endinterior",0);
dini_FloatSet(hf,"startfloatx",X);
dini_FloatSet(hf,"startfloaty",Y);
dini_FloatSet(hf,"startfloatz",Z);
dini_IntSet(hf,"endfloatx",0);
dini_IntSet(hf,"endfloaty",0);
dini_IntSet(hf,"endfloatz",0);
CreateNewTeleport(hid);
return 1;
}
return 1;
}

Okay so i've tried to make one command for my server, and it dosent work.

Quote:

C:\Users\User\Desktop\GC-RP.pwn(20815) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\GC-RP.pwn(20816) : warning 213: tag mismatch
C:\Users\User\Desktop\GC-RP.pwn(20816) : error 035: argument type mismatch (argument 2)

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Quote:

dini_Set(hid,"tpName", tpNames); == C:\Users\User\Desktop\GC-RP.pwn(20815) : error 035: argument type mismatch (argument 1)
myStrcpy(biz[hid][tpName],tpNames); == C:\Users\User\Desktop\GC-RP.pwn(20816) : error 035: argument type mismatch (argument 2)




Re: Need Help [Error 035] [+REP] - LondonRP - 07.02.2017

bump anyone fast pls?


Re: Need Help [Error 035] [+REP] - Sanady - 07.02.2017

Ok so, I guess that you copy that code from somewhere, second you are using sscanf wrongly:
PHP код:
sscanf(params"sz"hid ,tpNames
So I noticed that hid is variable which is carrying info from function ReturnNextUnusedTeleport(); but return from this function is integer or string, that is my first question and second which specifier in sscanf fucntion is "z" I am not looking and I haven`t saw that specifier yet. Oh by the way this are the correct specifiers:



Re: Need Help [Error 035] [+REP] - LondonRP - 07.02.2017

Quote:
Originally Posted by Sanady
Посмотреть сообщение
Ok so, I guess that you copy that code from somewhere, second you are using sscanf wrongly:
PHP код:
sscanf(params"sz"hid ,tpNames
So I noticed that hid is variable which is carrying info from function ReturnNextUnusedTeleport(); but return from this function is integer or string, that is my first question and second which specifier in sscanf fucntion is "z" I am not looking and I haven`t saw that specifier yet. Oh by the way this are the correct specifiers:
okay thanks but what should i do with dini_set how to fix that?


Quote:

dini_Set(hid,"tpName", tpNames);
myStrcpy(biz[hid][tpName],tpNames);




Re: Need Help [Error 035] [+REP] - Sanady - 07.02.2017

Quote:
Originally Posted by LondonRP
Посмотреть сообщение
okay thanks but what should i do with dini_set how to fix that?
Firstly fix that what I posted then you will see what compiler will output you and post it here.


Re: Need Help [Error 035] [+REP] - LondonRP - 07.02.2017

Quote:
Originally Posted by Sanady
Посмотреть сообщение
Firstly fix that what I posted then you will see what compiler will output you and post it here.
Quote:

C:\Users\User\Desktop\GC-RP.pwn(20814) : error 035: argument type mismatch (argument 1)
C:\Users\User\Desktop\GC-RP.pwn(20815) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase.

same lines.