errors ??
#1

what am i doing wrong i posted on here and some one told me to do this and i got errors how can i fix this or is completely wrong??
Код:
new PlayerWeapon[MAX_PLAYERS][12];
new PlayerWeaponAmmo[MAX_PLAYERS][12];


public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new vehicleid =GetPlayerVehicleID(playerid);
    new pname[MAX_PLAYER_NAME];

    GetPlayerName(playerid, pname, sizeof pname);
    if (newstate == PLAYER_STATE_DRIVER)
    {
        for( new i; i != sizeof vcar; i++ )
        {
            if (vehicleid == vcar[i])
            {
                if(strcmp(pname, vcar_names[i], true) == 0)
                {
                    SendClientMessage(playerid, COLOR_RED, "WELCOME VIP");
                }

                else
                {
                    RemovePlayerFromVehicle(playerid);
                    SendClientMessage(playerid, COLOR_RED, "THIS VEHICLE DOES NOT BELONG TO YOU");
                }
            }
        }
    }
    return 1;
}




	if (newstate==PLAYER_STATE_DRIVER){  // line 1476
	 	for(new i=0;i<12;i++){
			GetPlayerWeaponData(playerid, i, PlayerWeapon[playerid][i], PlayerWeaponAmmo[playerid][i]);
		}
	    ResetPlayerWeapons(playerid);
	}
	if (newstate==PLAYER_STATE_ONFOOT && oldstate==PLAYER_STATE_DRIVER){
	 	for(new i=0;i<12;i++){
	 	    GivePlayerWeapon(playerid, PlayerWeapon[playerid][i], PlayerWeaponAmmo[playerid][i]);
		}
	}
	return 1;
}
can some one fix this?


edit:
Код:
:\Documents and Settings\Administrator\Desktop\SA SERVER\OFFICAL SERVER\gamemodes\xlgwolds.pwn(1476) : error 010: invalid function or declaration
C:\Documents and Settings\Administrator\Desktop\SA SERVER\OFFICAL SERVER\gamemodes\xlgwolds.pwn(1477) : error 010: invalid function or declaration
C:\Documents and Settings\Administrator\Desktop\SA SERVER\OFFICAL SERVER\gamemodes\xlgwolds.pwn(1482) : error 010: invalid function or declaration
C:\Documents and Settings\Administrator\Desktop\SA SERVER\OFFICAL SERVER\gamemodes\xlgwolds.pwn(1483) : error 010: invalid function or declaration
C:\Documents and Settings\Administrator\Desktop\SA SERVER\OFFICAL SERVER\gamemodes\xlgwolds.pwn(1487) : error 010: invalid function or declaration
C:\Documents and Settings\Administrator\Desktop\SA SERVER\OFFICAL SERVER\gamemodes\xlgwolds.pwn(3159) : warning 235: public function lacks forward declaration (symbol "OnPlayerPrivmsg")
C:\Documents and Settings\Administrator\Desktop\SA SERVER\OFFICAL SERVER\gamemodes\xlgwolds.pwn(3542) : warning 203: symbol is never used: "PlayerWeapon"
C:\Documents and Settings\Administrator\Desktop\SA SERVER\OFFICAL SERVER\gamemodes\xlgwolds.pwn(3542) : warning 203: symbol is never used: "PlayerWeaponAmmo"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
Reply
#2

can u tell us the errors
Reply
#3

Quote:
Originally Posted by FireWarrior101
Посмотреть сообщение
can u tell us the errors
yes sorry i add them
Reply
#4

Code starting on line 1476 appears to be outside of any callbacks or functions.
Reply
#5

im a newb scripter explain in detail please
Reply
#6

its done thanks remove or lock topic /lock
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)