help me plz -
Cancel2 - 19.02.2015
hi i newbie here
i have problem
Код:
J:\New folder (2)\arab and india roleplay\gamemodes\RP.pwn(4222) : warning 225: unreachable code
J:\New folder (2)\arab and india roleplay\gamemodes\RP.pwn(18216) : warning 202: number of arguments does not match definition
J:\New folder (2)\arab and india roleplay\gamemodes\RP.pwn(18216) : warning 202: number of arguments does not match definition
J:\New folder (2)\arab and india roleplay\gamemodes\RP.pwn(47528) : warning 219: local variable "query" shadows a variable at a preceding level
J:\New folder (2)\arab and india roleplay\gamemodes\RP.pwn(47697) : error 017: undefined symbol "Cash"
J:\New folder (2)\arab and india roleplay\gamemodes\RP.pwn(47697) : warning 215: expression has no effect
J:\New folder (2)\arab and india roleplay\gamemodes\RP.pwn(47697) : error 001: expected token: ";", but found "]"
J:\New folder (2)\arab and india roleplay\gamemodes\RP.pwn(47697) : error 029: invalid expression, assumed zero
J:\New folder (2)\arab and india roleplay\gamemodes\RP.pwn(47697) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
how to fix it?
Re: help me plz -
CalvinC - 19.02.2015
You can take a look here if you want to fix it yourself:
https://sampwiki.blast.hk/wiki/Errors_List
Or ****** the errors, otherwise show the code.
Re: help me plz -
Cancel2 - 19.02.2015
line 4222:
Код:
MySQLCheckConnection();
line 18216:
Код:
CreateVehicle(CarInfo[vehid][cModel],CarInfo[vehid][cLocationx],CarInfo[vehid][cLocationy],CarInfo[vehid][cLocationz]+1.0,CarInfo[vehid][cAngle],60000);
line 47528:
Код:
public MySQLUpdatePlayerFlo(query[], sqlplayerid, sqlvalname[], Float:sqlupdateflo) //
{
new query[128];
format(query, sizeof(query), "UPDATE players SET %s=%f WHERE id=%d", sqlvalname, sqlupdateflo, sqlplayerid);
samp_mysql_query(query);
new flotostr[32];
format(flotostr, sizeof(flotostr), "%f", sqlupdateflo);
MySQLUpdatePlayerStr(query, sqlplayerid, sqlvalname, flotostr);
return 1;
}
line 47697:
Код:
public GetPlayerCash(playerid)
{
Cash[playerid];
return 1;
}
Re: help me plz -
Cancel2 - 19.02.2015
Help me Please!
Re: help me plz -
CalvinC - 19.02.2015
With line 4222, show more code, as it being unreachable is caused by other code.
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*/)
As you can see, you are only using 6, while really, there are 8, you should be using it like this:
pawn Код:
CreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay)
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:
pawn Код:
public GetPlayerCash(playerid) return Cash[playerid];
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:
pawn Код:
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, Cash[playerid]);
To set the player's money to his "Cash" value.