Basic Code Problem..
#1

I could not fix code :/

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
if((
newkeys KEY_YES**) && (newkeys KEY_NO**)) && GetPlayerVehicleID(playerid) == 0){
}
}
return 
1;

PHP код:
error 001expected token";"but found ")" 
Reply
#2

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.
Reply
#3

Код:
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.
Reply
#4

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(playeridnewkeysoldkeys){
if((
newkeys KEY_YES) && (newkeys KEY_NO) && (GetPlayerVehicleID(playerid) == 0)){
switch(
GetWeaponSlot(GetPlayerWeapon(playerid))){
case 
01811: {
SyncPlayer(playerid);}}}
return 
1;} 
Problem solved thanks guys !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)