daily pastebin goal
43%
SHARE
TWEET

Untitled

a guest Oct 21st, 2018 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function AddPlayerVehicle(playerid) {
  2.     new szQuery2[256];
  3.     mysql_format(SQL, szQuery2, sizeof(szQuery2), "INSERT INTO pvehicles (`Model`, `Owner`,`Name`) VALUES ('%d', '%s', '%s')", DSModel[playerid], PlayerInfo[playerid][pName], aVehicleNames[DSModel[playerid] - 400]);
  4.     mysql_tquery(SQL, szQuery2);
  5.     new szQuery[256], i = pvehs+1;
  6.     if(PlayerInfo[playerid][pCarKey][0] == 0) {
  7.         PlayerInfo[playerid][pCarKey][0] = i;
  8.         mysql_format(SQL, szQuery, sizeof(szQuery), "UPDATE `users` SET `CarKey` = '%d' WHERE `Name` = '%s'", i, getName(playerid));
  9.         mysql_tquery(SQL, szQuery);
  10.         PlayerVehicle[PlayerInfo[playerid][pCarKey][0]][pSQLID] = PlayerInfo[playerid][pSQLID];
  11.         mysql_format(SQL, szQuery, sizeof(szQuery), "UPDATE `pvehicles` SET `SQLID` = '%d', `CarColor1` = '1', `CarColor2` = '1', `PosX` = '2147.6511', `PosY` = '-1170.8748',`PosZ` = '23.4453',`ZAngle` = '270.2680' WHERE `ID` = '%d'", PlayerInfo[playerid][pSQLID], PlayerInfo[playerid][pCarKey][0]);
  12.         mysql_tquery(SQL, szQuery);
  13.     }
  14.     else if(PlayerInfo[playerid][pCarKey][1] == 0) {
  15.         PlayerInfo[playerid][pCarKey][1] = i;
  16.         mysql_format(SQL, szQuery, sizeof(szQuery), "UPDATE `users` SET `CarKey1` = '%d' WHERE `Name` = '%s'", i, getName(playerid));
  17.         mysql_tquery(SQL, szQuery);
  18.         PlayerVehicle[PlayerInfo[playerid][pCarKey][1]][pSQLID] = PlayerInfo[playerid][pSQLID];
  19.         mysql_format(SQL, szQuery, sizeof(szQuery), "UPDATE `pvehicles` SET `SQLID` = '%d', `CarColor1` = '1', `CarColor2` = '1', `PosX` = '2147.6511', `PosY` = '-1170.8748',`PosZ` = '23.4453',`ZAngle` = '270.2680' WHERE `ID` = '%d'", PlayerInfo[playerid][pSQLID], PlayerInfo[playerid][pCarKey][1]);
  20.         mysql_tquery(SQL, szQuery);
  21.     }
  22.     else if(PlayerInfo[playerid][pCarKey][2] == 0) {
  23.         PlayerInfo[playerid][pCarKey][2] = i;
  24.         mysql_format(SQL, szQuery, sizeof(szQuery), "UPDATE `users` SET `CarKey2` = '%d' WHERE `Name` = '%s'", i, getName(playerid));
  25.         mysql_tquery(SQL, szQuery);
  26.         PlayerVehicle[PlayerInfo[playerid][pCarKey][2]][pSQLID] = PlayerInfo[playerid][pSQLID];
  27.         mysql_format(SQL, szQuery, sizeof(szQuery), "UPDATE `pvehicles` SET `SQLID` = '%d', `CarColor1` = '1', `CarColor2` = '1', `PosX` = '2147.6511', `PosY` = '-1170.8748',`PosZ` = '23.4453',`ZAngle` = '270.2680' WHERE `ID` = '%d'", PlayerInfo[playerid][pSQLID], PlayerInfo[playerid][pCarKey][2]);
  28.         mysql_tquery(SQL, szQuery);
  29.     }
  30.     else if(PlayerInfo[playerid][pCarKey][3] == 0) {
  31.         PlayerInfo[playerid][pCarKey][3] = i;
  32.         mysql_format(SQL, szQuery, sizeof(szQuery), "UPDATE `users` SET `CarKey3` = '%d' WHERE `Name` = '%s'", i, getName(playerid));
  33.         mysql_tquery(SQL, szQuery);
  34.         PlayerVehicle[PlayerInfo[playerid][pCarKey][3]][pSQLID] = PlayerInfo[playerid][pSQLID];
  35.         mysql_format(SQL, szQuery, sizeof(szQuery), "UPDATE `pvehicles` SET `SQLID` = '%d', `CarColor1` = '1', `CarColor2` = '1', `PosX` = '2147.6511', `PosY` = '-1170.8748',`PosZ` = '23.4453',`ZAngle` = '270.2680' WHERE `ID` = '%d'", PlayerInfo[playerid][pSQLID], PlayerInfo[playerid][pCarKey][3]);
  36.         mysql_tquery(SQL, szQuery);
  37.     }
  38.     else if(PlayerInfo[playerid][pCarKey][4] == 0) {
  39.         PlayerInfo[playerid][pCarKey][4] = i;
  40.         PlayerVehicle[PlayerInfo[playerid][pCarKey][4]][pSQLID] = PlayerInfo[playerid][pSQLID];
  41.         mysql_format(SQL, szQuery, sizeof(szQuery), "UPDATE `pvehicles` SET `SQLID` = '%d', `CarColor1` = '1', `CarColor2` = '1', `PosX` = '2147.6511', `PosY` = '-1170.8748',`PosZ` = '23.4453',`ZAngle` = '270.2680' WHERE `ID` = '%d'", PlayerInfo[playerid][pSQLID], PlayerInfo[playerid][pCarKey][4]);
  42.         mysql_tquery(SQL, szQuery);
  43.     }
  44.     new query[256];
  45.     mysql_format(SQL, query, sizeof(query), "SELECT * FROM pvehicles");
  46.     mysql_tquery(SQL, query, "LoadPVehicles", "");
  47.     LoadPVehicles();
  48.     return 1; }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top