Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new WeaponInfo[MAX_PLAYERS][13][2];
- // Žaidėjas užsiregistruoja
- mysql_format(ConnectionHandle, query, "INSERT INTO `weapons` (Name) VALUES ('%s')", PlayerName(playerid));
- mysql_function_query(ConnectionHandle, query, false, "", "");
- // Ginklų informacijos saugojimas [OnPlayerDisconnect]
- for(new i = 0; i < 13; i++)
- {
- GetPlayerWeaponData(playerid, i, WeaponInfo[playerid][i][0], WeaponInfo[playerid][i][1]);
- mysql_format(ConnectionHandle, query, "UPDATE `weapons` SET `Weapon%i` = '%i', `Ammo%i` = '%i' WHERE `Name` = '%s'", i, WeaponInfo[playerid][i][0], i, WeaponInfo[playerid][i][1], PlayerName(playerid));
- mysql_function_query(ConnectionHandle, query, false, "", "");
- }
- // Ginklų informacijos krovimas [OnPlayerSpawn]
- new _string[14], _tempstr[11];
- for(new i = 0; i < 13; i++)
- {
- format(_string, sizeof(_string), "Weapon%i", i);
- cache_get_field_content(0, _string, _tempstr);
- WeaponInfo[playerid][i][0] = strval(_tempstr);
- format(_string, 12, "Ammo%i", i);
- cache_get_field_content(0, _string, _tempstr);
- WeaponInfo[playerid][i][1] = strval(_tempstr);
- GivePlayerWeapon(playerid, WeaponInfo[playerid][i][0], WeaponInfo[playerid][i][1]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement