30.03.2013, 15:03
Worked a treat thanks. Just got the coordinates wrong somehow
You see the way I have set the variables from the db array is that the best way? That is the way I would do it in PHP but I don't see lots of lines like that in other peoples code.
This is what I am talking about
You see the way I have set the variables from the db array is that the best way? That is the way I would do it in PHP but I don't see lots of lines like that in other peoples code.
This is what I am talking about
Код:
// EXPLANATION OF cache_get_row: // THE FIRST VAR IS THE ROW FOUND. // THE SECOND VAR IS THE COLUMN OF THE ROW. // THE THIRD VAR IS A TEMPORARY VAR IN WHICH I STORE THE RESULT -- AFTERWARDS I ASSIGN THAT VALUE INTO A LOCAL ONE. cache_get_row(0, 0, szQueryOutput); // pInternalID playerVariables[playerid][pInternalID] = strval(szQueryOutput); cache_get_row(0, 16, szQueryOutput); playerVariables[playerid][pHasDrivingLicence] = strval(szQueryOutput); cache_get_row(0, 3, szQueryOutput); // Skin playerSkin = strval(szQueryOutput); cache_get_row(0, 4, szQueryOutput); playerCash = strval(szQueryOutput); cache_get_row(0, 5, szQueryOutput); playerSpawnX = strval(szQueryOutput); cache_get_row(0, 6, szQueryOutput); playerSpawnY = strval(szQueryOutput); cache_get_row(0, 7, szQueryOutput); playerSpawnX = strval(szQueryOutput); cache_get_row(0, 8, szQueryOutput); playerSpawnAngle = strval(szQueryOutput); SetSpawnInfo(playerid,0,playerSkin,playerSpawnX,playerSpawnY,playerSpawnZ,playerSpawnAngle,-1,-1,-1,-1,-1,-1); SpawnPlayer(playerid); GivePlayerMoney(playerid,playerCash);