SA-MP Forums Archive
id NOT SET - 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: id NOT SET (/showthread.php?tid=662820)



id NOT SET - playstores - 12.01.2019

Quote:

stock CreateOrganisation(organisation[],playerid)
{
new query[256];

format(query,sizeof(query),"YYou created Organisation '%s' sucessfully.",organisation);
SendClientMessage(playerid,COLOR_LIGHTBLUE,query);

GivePlayerMoneySave(playerid, -500000);


format(query,sizeof(query),"INSERT INTO organisations (OrgName,OrgOwner,OrgMotto) VALUES ('%s','%s','%s')",organisation,GetName(playerid)," Nothing");
mysql_function_query(mysqlcon,query,true,"is","OnO RGCreated",playerid,organisation);
return 1;

}



forward OnORGCreated(playerid,orgnmame[]);
public OnORGCreated(playerid,orgnmame[])
{
new id = mysql_insert_id();
PlayerInfo[playerid][pOrgMember] = id;
PlayerInfo[playerid][pOrgLeader] = id;
OrgInfo[id][OrgCreatet] = 1;
strmid(OrgInfo[id][OrgOwner],PlayerInfo[playerid][Name],0,strlen(PlayerInfo[playerid][Name]),24);
strmid(OrgInfo[id][OrgMotto],"Noting",0,strlen("Nothing"),128 );
strmid(OrgInfo[id][OrgName], orgnmame, 0, MAX_PLAYER_NAME, MAX_PLAYER_NAME);
return 1;
}


"pOrgMember" & "pOrgLeader" just stays 0

But the INSERT is sucessfull & the id is KEY & AUTO INCREMENT


Whats the problem?


Re: id NOT SET - Calisthenics - 12.01.2019

Your parameters are wrong. It expects the callback name first and then the format, not the other way around.
Код:
mysql_function_query( connectionHandle, query[], bool:cache, callback[], format[], {Float,_}:... )



Re: id NOT SET - playstores - 12.01.2019

thx mate