Basic Code Problem.. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Basic Code Problem.. (
/showthread.php?tid=604419)
Basic Code Problem.. -
ProRakNet - 04.04.2016
I could not fix code :/
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((newkeys & KEY_YES**) && (newkeys & KEY_NO**)) && GetPlayerVehicleID(playerid) == 0){
}
}
return 1;
}
PHP код:
error 001: expected token: ";", but found ")"
Re: Basic Code Problem.. -
AndySedeyn - 04.04.2016
Don't put the asterisks behind KEY_YES. They are meant to redirect the reader to a footnote (extra information) about them at the bottom of the wiki page. You're also closing the if-statement before '&& GetPlayerVehicleID(playerid) == 0)' making it a syntactically incorrect statement.
Plus, you've got a trailing closing bracket.
Re: Basic Code Problem.. -
-CaRRoT - 04.04.2016
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_YES && GetPlayerVehicleID(playerid) == 0)
{
// code.
}
return 1;
}
You code made no sense what so ever, plus I am not sure why are you checking if the vehicle ID is 0.
Re: Basic Code Problem.. -
ProRakNet - 04.04.2016
Quote:
Originally Posted by -CaRRoT
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_YES && GetPlayerVehicleID(playerid) == 0)
{
// code.
}
return 1;
}
You code made no sense what so ever, plus I am not sure why are you checking if the vehicle ID is 0.
|
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){
if((newkeys & KEY_YES) && (newkeys & KEY_NO) && (GetPlayerVehicleID(playerid) == 0)){
switch(GetWeaponSlot(GetPlayerWeapon(playerid))){
case 0, 1, 8, 11: {
SyncPlayer(playerid);}}}
return 1;}
Problem solved thanks guys !