Search

open.mp forum

RegisterLogin

Discussion

General
Chat
Tech
Life
Art
Programming
open.mp
Development Updates
Questions and Suggestions
SA-MP
General Discussions
Videos and Screenshots
Support
Pawn Scripting
Tutorials
Releases
Plugins
Libraries
Filterscripts
Gamemodes
Maps
Advertisements
Other languages
Spanish/Espa?ol
Programaci?n
Discusi?n GTA SA Multijugador
Mods
Offtopic
Juegos
Portuguese/Portugu?s
Russian/???????
Italian/Italiano
Dutch/Nederlands
German/Deutsch
Romanian/Rom?na
Ex-Yu
Polish/Polski
Og?lne
Serwery
Skryptowanie
Filmiki i zdjecia
Lithuanian/Lietuvi?kas
French/Fran?ais
Hungarian/Magyar
Hindi/Urdu
Turkish
Other
Internal
Team
Hidden
Archived

Library

 Collections Links Members Roles

cache_insert_id always return 0

Hi, sorry how bad this was.

ID
d6ouivnilegovhg7bv50
author
axitz's avatar

Axitz

@axitz


View profile
Copy link
  Report member
started
Mar 30, 2022
replies
0
participating
No

scroll to top

powered by storyden

Login
Discussion
Pawn Scripting
cache_insert_id always return 0
axitz's avatar

Axitz

@axitz


View profile
Copy link
  Report member
• 4y
Pawn Scripting

cache_insert_id always return 0

pawn

Hi, sorry how bad this was.

I've created a team and the table is also is AI mode. There are multiples team in the query but whenever server restart or player quit, then create team, it always started at 0 again.

forward TeamCreated(b);
public TeamCreated(b)
{

? ? TeamInfo = cache_insert_id();
? ? teamidd;
? ? printf("New Group is created: ", teamidd );
}




if(strcmp(usage, "create", false) == 0)
{
? ? if(!strlen(usage1)) return SCP(playerid, "create <teamname>");
? ? if(strlen(usage1) < 5 || strlen(usage1) > 30) return SendClientError(playerid, "Your team name is too short or too long! (Min 5, Max 30 chars)");
? ? new tmID = teamidd;
? ? if(PlayerInfo != -1) return SendClientError(playerid, "You are already in a team. /team leave");
? ? TeamInfo = tmID;
? ? PlayerInfo = tmID;
? ? PlayerInfo = 0;
? ? myStrcpy(PlayerInfo,usage1);
? ? myStrcpy(PlayerInfo,"Children");
? ? TeamInfo=true;
new sQuery;
mysql_format(sqldb, sQuery, sizeof sQuery, "INSERT INTO `TeamInfo` (`TeamID`, `TeamName`, `StartRank`) VALUES (%d,'%e', 'Children')",tmID,usage1);
mysql_tquery(sqldb, sQuery, "TeamCreated", "i",tmID);
}
else
{
SCP(playerid, "<create> <input>");
}
return 1;
}
0 likes0 replies

    Please sign up or log in to reply