19.02.2015, 11:43
With line 4222, show more code, as it being unreachable is caused by other code.
Line 18216, you are using the wrong parameters:
As you can see, you are only using 6, while really, there are 8, you should be using it like this:
Which means you forgot "color1" and "color2".
Line 47528, should be easily fixed by renaming "query" to something else, like "myquery".
Line 47697, you haven't defined "Cash" anywhere.
To get the player's money, use GetPlayerMoney.
And also, that "GetPlayerCash" function is useless, but let's start:
1.
If you want to return the "Cash" variable, first create it:
Put that in the top of your script, then use "Cash[playerid] = amount;" to set the player's "Cash" variable.
Or use "Cash[playerid] += amount;" to add to the previous "Cash" value.
Or finally, use "Cash -= amount;" to take away from the previous "Cash" value.
2.
If you need to use such a function, use it like this:
Although, it isn't necessary, as you can just use "Cash[playerid]", which will be the same as using "GetPlayerCash(playerid)".
As an example, you can simply do:
To set the player's money to his "Cash" value.
Line 18216, you are using the wrong parameters:
pawn Код:
CreateVehicle(CarInfo[vehid][cModel] /*1*/, CarInfo[vehid][cLocationx] /*2*/, CarInfo[vehid][cLocationy] /*3*/, CarInfo[vehid][cLocationz]+1.0 /*4*/, CarInfo[vehid][cAngle] /*5*/, 60000 /*6*/)
pawn Код:
CreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay)
Line 47528, should be easily fixed by renaming "query" to something else, like "myquery".
Line 47697, you haven't defined "Cash" anywhere.
To get the player's money, use GetPlayerMoney.
And also, that "GetPlayerCash" function is useless, but let's start:
1.
If you want to return the "Cash" variable, first create it:
pawn Код:
new Cash[MAX_PLAYERS];
Or use "Cash[playerid] += amount;" to add to the previous "Cash" value.
Or finally, use "Cash -= amount;" to take away from the previous "Cash" value.
2.
If you need to use such a function, use it like this:
pawn Код:
public GetPlayerCash(playerid) return Cash[playerid];
As an example, you can simply do:
pawn Код:
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, Cash[playerid]);