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

MySQL Weapon save custom

They saved every weapon from the server after disconnected

ID
d6ouivfilegovhg7bd8g
author
zow's avatar

Zow

@zow


View profile
Copy link
  Report member
started
Sep 30, 2019
replies
0
participating
No

scroll to top

powered by storyden

Login
Discussion
Pawn Scripting
MySQL Weapon save custom
zow's avatar

Zow

@zow


View profile
Copy link
  Report member
• 6y
Pawn Scripting

MySQL Weapon save custom

pawn

They saved every weapon from the server after disconnected

But I wants them to custom save

exam: /getgun from the gang = not save

/weapon = save

sorry for my bad explain I don't know how to explain to be clear



public OnPlayerDisconnect(playerid, reason)

{

for (new i = 0; i <= 12; i)

{

? ?GetPlayerWeaponData(playerid, i, weapons1, weapons1);

? ?if(!weapons1) continue; // don't insert if there's no weapon in this slot

mysql_format(dbCon, query, sizeof(query), "INSERT INTO `WeaponData` (ID, WeaponID, Ammo) VALUES (%d, %d, %d) ON DUPLICATE KEY UPDATE `Ammo` = `Ammo`  %d", PlayerInfo, weapons1, weapons1, weapons1);

mysql_query(dbCon, query);

printf("weapon: %d, ammo: %d", weapons1, weapons1);

}

return 1;

}





?if(strcmp(cmd, "/weapon", true) == 0)

?{

???? GivePlayerWeapon(playerid, 24, 500);

???? GivePlayerWeapon(playerid, 30, 500);

???? GivePlayerWeapon(playerid, 8, 1);

?}



?if(strcmp(cmd, "/getgun", true) == 0)

?{

???? GivePlayerWeapon(playerid, 24, 500);

???? GivePlayerWeapon(playerid, 30, 500);

???? GivePlayerWeapon(playerid, 8, 1);

?}
0 likes0 replies

    Please sign up or log in to reply