Problem with faction leadering -
ImMuslimNigga - 29.12.2015
I have a little problem, i dont know how to define this command for the Faction leaders..
Код:
CMD:commanderbateau(playerid,params[])
{
if(PlayerInfo[playerid][pFacleader] > 2 || PlayerInfo[playerid][pFacleader] > 3 || PlayerInfo[playerid][pFacrank] >= 8) } // 318
for(new i = 0; i < MAX_PLAYERS; i++) {
if(ControllingShip[i] == 1) return SendClientMessage(playerid, -1,"Le navire est actuellement dйtenu а commande par quelqu'un d'autre.");
}
Camera = CreateObject(0, 0,0,0,0,0,0);
AttachCameraToObject(playerid, Camera);
AttachObjectToVehicle(Camera, PirateShip,0,-35,23,0.000000,0.000000,0.0);
PutPlayerInVehicle(playerid, PirateShip, 0);
ControllingShip[playerid] = 1;
SendClientMessage(playerid, -1,"Tape /quitterbateau ou appuie sur 'F' si tu veux arrкter de commander ce navire.");
return 1;
}
Код:
C:\Users\..\Desktop\Login and Register Sytem Y_INI\gamemodes\test.pwn(318) : error 029: invalid expression, assumed zero
C:\Users\..\Desktop\Login and Register Sytem Y_INI\gamemodes\test.pwn(318 -- 319) : warning 215: expression has no effect
C:\Users\..\Desktop\Login and Register Sytem Y_INI\gamemodes\test.pwn(319) : error 001: expected token: ";", but found "for"
Re: Problem with faction leadering -
AndySedeyn - 29.12.2015
You're closing the whole function right after that if statement. You're not even opening the if statement.
This is the closing bracket:
This is the opening bracket:
They mark the beginning and ending of function blocks.
Re: Problem with faction leadering -
ImMuslimNigga - 30.12.2015
C:\Users\..\Desktop\Login and Register Sytem Y_INI\gamemodes\test.pwn(31

: error 029: invalid expression, assumed zero
C:\Users\..\Desktop\Login and Register Sytem Y_INI\gamemodes\test.pwn(318 -- 319) : warning 215: expression has no effect
C:\Users\..\Desktop\Login and Register Sytem Y_INI\gamemodes\test.pwn(319) : error 001: expected token: ";", but found "for"
C:\Users\..\Desktop\Login and Register Sytem Y_INI\gamemodes\test.pwn(332) : error 029: invalid expression, assumed zero
C:\Users\..\Desktop\Login and Register Sytem Y_INI\gamemodes\test.pwn(332) : error 017: undefined symbol "cmd_quitterbateau"
C:\Users\..\Desktop\Login and Register Sytem Y_INI\gamemodes\test.pwn(332) : error 029: invalid expression, assumed zero
C:\Users\..\Desktop\Login and Register Sytem Y_INI\gamemodes\test.pwn(332) : fatal error 107: too many error messages on one line
Re: Problem with faction leadering -
AndySedeyn - 30.12.2015
Try this:
PHP код:
CMD:commanderbateau(playerid, params[]) {
if(PlayerInfo[playerid][pFacleader] > 2 || PlayerInfo[playerid][pFacleader] > 3 || PlayerInfo[playerid][pFaclank] >= 8) {
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i ++) {
if(ControllingShip[i] == 1) {
return SendClientMessage(playerid, -1, "Le navire est actuellement dйtenu а commande par quelqu'un d'autre.");
}
}
Camera = CreateObject(0, 0, 0, 0, 0, 0, 0);
AttachCameraToObject(playerid, Camera);
AttachObjectToVehicle(Camera, PirateShip, 0, -35, 23, 0.0, 0.0, 0.0);
PutPlayerInVehicle(playerid, PirateShip, 0);
ControllingShip[playerid] = 1;
SendClientMessage(playerid, -1, "Tape /quiiterbateau ou appuie sur 'F' si tu vuew arrкter de commander ce navire.");
}
return 1;
}
I usually don't spoon feed code, but I've got a feeling that you won't know how to fix these errors even if I told you what to do. Look at the code above and tell me which parts you don't understand and I'll happily explain them to you.
Re: Problem with faction leadering -
ImMuslimNigga - 31.12.2015
You are the best man, thank you(+1 rep). I was thinking we can't add two brackets..