if(listitem == 0)
{
GetPlayerWeaponData(playerid, 1, WeaponInfo[playerid][Weapon1], WeaponInfo[playerid][Weapon1a]);
GetPlayerWeaponData(playerid, 2, WeaponInfo[playerid][Weapon2], WeaponInfo[playerid][Weapon2a]);
GetPlayerWeaponData(playerid, 3, WeaponInfo[playerid][Weapon3], WeaponInfo[playerid][Weapon3a]);
GetPlayerWeaponData(playerid, 4, WeaponInfo[playerid][Weapon4], WeaponInfo[playerid][Weapon4a]);
GetPlayerWeaponData(playerid, 5, WeaponInfo[playerid][Weapon5], WeaponInfo[playerid][Weapon5a]);
GetPlayerWeaponData(playerid, 6, WeaponInfo[playerid][Weapon6], WeaponInfo[playerid][Weapon6a]);
GetPlayerWeaponData(playerid, 7, WeaponInfo[playerid][Weapon7], WeaponInfo[playerid][Weapon7a]);
GetPlayerWeaponData(playerid, 8, WeaponInfo[playerid][Weapon8], WeaponInfo[playerid][Weapon8a]);
GetPlayerWeaponData(playerid, 9, WeaponInfo[playerid][Weapon9], WeaponInfo[playerid][Weapon9a]);
GetPlayerWeaponData(playerid, 10, WeaponInfo[playerid][Weapon10], WeaponInfo[playerid][Weapon10a]);
GetPlayerWeaponData(playerid, 11, WeaponInfo[playerid][Weapon11], WeaponInfo[playerid][Weapon11a]);
GetPlayerWeaponData(playerid, 12, WeaponInfo[playerid][Weapon12], WeaponInfo[playerid][Weapon12a]);
new INI:PouzivatelovSubor2 = INI_Open (PouzivateloveUmiestnenie2 (playerid));
INI_SetTag (PouzivatelovSubor2, "Guns");
INI_WriteInt (PouzivatelovSubor2, "Slot1", WeaponInfo[playerid][Weapon1]);
INI_WriteInt (PouzivatelovSubor2, "Slot1ammo", WeaponInfo[playerid][Weapon1a]);
INI_WriteInt (PouzivatelovSubor2, "Slot2", WeaponInfo[playerid][Weapon2]);
INI_WriteInt (PouzivatelovSubor2, "Slot2ammo", WeaponInfo[playerid][Weapon2a]);
INI_WriteInt (PouzivatelovSubor2, "Slot3", WeaponInfo[playerid][Weapon3]);
INI_WriteInt (PouzivatelovSubor2, "Slot3ammo", WeaponInfo[playerid][Weapon3a]);
INI_WriteInt (PouzivatelovSubor2, "Slot4", WeaponInfo[playerid][Weapon4]);
INI_WriteInt (PouzivatelovSubor2, "Slot4ammo", WeaponInfo[playerid][Weapon4a]);
INI_WriteInt (PouzivatelovSubor2, "Slot5", WeaponInfo[playerid][Weapon5]);
INI_WriteInt (PouzivatelovSubor2, "Slot5ammo", WeaponInfo[playerid][Weapon5a]);
INI_WriteInt (PouzivatelovSubor2, "Slot6", WeaponInfo[playerid][Weapon6]);
INI_WriteInt (PouzivatelovSubor2, "Slot6ammo", WeaponInfo[playerid][Weapon6a]);
INI_WriteInt (PouzivatelovSubor2, "Slot7", WeaponInfo[playerid][Weapon7]);
INI_WriteInt (PouzivatelovSubor2, "Slot7ammo", WeaponInfo[playerid][Weapon7a]);
INI_WriteInt (PouzivatelovSubor2, "Slot8", WeaponInfo[playerid][Weapon8]);
INI_WriteInt (PouzivatelovSubor2, "Slot8ammo", WeaponInfo[playerid][Weapon8a]);
INI_WriteInt (PouzivatelovSubor2, "Slot9", WeaponInfo[playerid][Weapon9]);
INI_WriteInt (PouzivatelovSubor2, "Slot9ammo", WeaponInfo[playerid][Weapon9a]);
INI_WriteInt (PouzivatelovSubor2, "Slot10", WeaponInfo[playerid][Weapon10]);
INI_WriteInt (PouzivatelovSubor2, "Slot10ammo", WeaponInfo[playerid][Weapon10a]);
INI_WriteInt (PouzivatelovSubor2, "Slot11", WeaponInfo[playerid][Weapon11]);
INI_WriteInt (PouzivatelovSubor2, "Slot11ammo", WeaponInfo[playerid][Weapon11a]);
INI_WriteInt (PouzivatelovSubor2, "Slot12", WeaponInfo[playerid][Weapon12]);
INI_WriteInt (PouzivatelovSubor2, "Slot12ammo", WeaponInfo[playerid][Weapon12a]);
INI_Close (PouzivatelovSubor2);
ResetPlayerWeapons(playerid);
SendClientMessage(playerid, 0xFFFFFF, "You successfully saved weapon to slot 1!");
SlotTaken = 1;
else //LINE 437
if(SlotTaken == 1) //LINE 438
SendClientMessage(playerid, 0xFFFFFF, "In this slot is weapon already saved!");
}
else if(listitem == 1)
{
SendClientMessage(playerid,0xFFFFFFFF,"Uloћil jsi zbraт do slotu 2");
}
else if(listitem == 2)
{
SendClientMessage(playerid,0xFFFFFFFF,"Uloћil jsi zbraт do slotu 3");
}
}
}
}
return true;
}
Hello guys, I am making system to save weapons into slots in cars. I can't really know what is with "else" function, it gives an errors.
ERRORS: C:\Users\Jakub\Desktop\Las Venturas Roleplay\gamemodes\LVRP.pwn(437) : error 029: invalid expression, assumed zero C:\Users\Jakub\Desktop\Las Venturas Roleplay\gamemodes\LVRP.pwn(437 -- 43 : warning 215: expression has no effect C:\Users\Jakub\Desktop\Las Venturas Roleplay\gamemodes\LVRP.pwn(43 : error 001: expected token: ";", but found "if" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors. pawn Код:
|
if(SlotTaken == 1) //LINE 438
SendClientMessage(playerid, 0xFFFFFF, "In this slot is weapon already saved!");
if(SlotTaken == 1)//LINE 438
{
SendClientMessage(playerid, 0xFFFFFF, "In this slot is weapon already saved!");
}
else //LINE 437
{
if(SlotTaken == 1)
{
SendClientMessage(playerid, 0xFFFFFF, "In this slot is weapon already saved!");
}
}
}
if(listitem == 0)
{
GetPlayerWeaponData(playerid, 1, WeaponInfo[playerid][Weapon1], WeaponInfo[playerid][Weapon1a]);
GetPlayerWeaponData(playerid, 2, WeaponInfo[playerid][Weapon2], WeaponInfo[playerid][Weapon2a]);
GetPlayerWeaponData(playerid, 3, WeaponInfo[playerid][Weapon3], WeaponInfo[playerid][Weapon3a]);
GetPlayerWeaponData(playerid, 4, WeaponInfo[playerid][Weapon4], WeaponInfo[playerid][Weapon4a]);
GetPlayerWeaponData(playerid, 5, WeaponInfo[playerid][Weapon5], WeaponInfo[playerid][Weapon5a]);
GetPlayerWeaponData(playerid, 6, WeaponInfo[playerid][Weapon6], WeaponInfo[playerid][Weapon6a]);
GetPlayerWeaponData(playerid, 7, WeaponInfo[playerid][Weapon7], WeaponInfo[playerid][Weapon7a]);
GetPlayerWeaponData(playerid, 8, WeaponInfo[playerid][Weapon8], WeaponInfo[playerid][Weapon8a]);
GetPlayerWeaponData(playerid, 9, WeaponInfo[playerid][Weapon9], WeaponInfo[playerid][Weapon9a]);
GetPlayerWeaponData(playerid, 10, WeaponInfo[playerid][Weapon10], WeaponInfo[playerid][Weapon10a]);
GetPlayerWeaponData(playerid, 11, WeaponInfo[playerid][Weapon11], WeaponInfo[playerid][Weapon11a]);
GetPlayerWeaponData(playerid, 12, WeaponInfo[playerid][Weapon12], WeaponInfo[playerid][Weapon12a]);
new INI:PouzivatelovSubor2 = INI_Open (PouzivateloveUmiestnenie2 (playerid));
INI_SetTag (PouzivatelovSubor2, "Guns");
INI_WriteInt (PouzivatelovSubor2, "Slot1", WeaponInfo[playerid][Weapon1]);
INI_WriteInt (PouzivatelovSubor2, "Slot1ammo", WeaponInfo[playerid][Weapon1a]);
INI_WriteInt (PouzivatelovSubor2, "Slot2", WeaponInfo[playerid][Weapon2]);
INI_WriteInt (PouzivatelovSubor2, "Slot2ammo", WeaponInfo[playerid][Weapon2a]);
INI_WriteInt (PouzivatelovSubor2, "Slot3", WeaponInfo[playerid][Weapon3]);
INI_WriteInt (PouzivatelovSubor2, "Slot3ammo", WeaponInfo[playerid][Weapon3a]);
INI_WriteInt (PouzivatelovSubor2, "Slot4", WeaponInfo[playerid][Weapon4]);
INI_WriteInt (PouzivatelovSubor2, "Slot4ammo", WeaponInfo[playerid][Weapon4a]);
INI_WriteInt (PouzivatelovSubor2, "Slot5", WeaponInfo[playerid][Weapon5]);
INI_WriteInt (PouzivatelovSubor2, "Slot5ammo", WeaponInfo[playerid][Weapon5a]);
INI_WriteInt (PouzivatelovSubor2, "Slot6", WeaponInfo[playerid][Weapon6]);
INI_WriteInt (PouzivatelovSubor2, "Slot6ammo", WeaponInfo[playerid][Weapon6a]);
INI_WriteInt (PouzivatelovSubor2, "Slot7", WeaponInfo[playerid][Weapon7]);
INI_WriteInt (PouzivatelovSubor2, "Slot7ammo", WeaponInfo[playerid][Weapon7a]);
INI_WriteInt (PouzivatelovSubor2, "Slot8", WeaponInfo[playerid][Weapon8]);
INI_WriteInt (PouzivatelovSubor2, "Slot8ammo", WeaponInfo[playerid][Weapon8a]);
INI_WriteInt (PouzivatelovSubor2, "Slot9", WeaponInfo[playerid][Weapon9]);
INI_WriteInt (PouzivatelovSubor2, "Slot9ammo", WeaponInfo[playerid][Weapon9a]);
INI_WriteInt (PouzivatelovSubor2, "Slot10", WeaponInfo[playerid][Weapon10]);
INI_WriteInt (PouzivatelovSubor2, "Slot10ammo", WeaponInfo[playerid][Weapon10a]);
INI_WriteInt (PouzivatelovSubor2, "Slot11", WeaponInfo[playerid][Weapon11]);
INI_WriteInt (PouzivatelovSubor2, "Slot11ammo", WeaponInfo[playerid][Weapon11a]);
INI_WriteInt (PouzivatelovSubor2, "Slot12", WeaponInfo[playerid][Weapon12]);
INI_WriteInt (PouzivatelovSubor2, "Slot12ammo", WeaponInfo[playerid][Weapon12a]);
INI_Close (PouzivatelovSubor2);
ResetPlayerWeapons(playerid);
SendClientMessage(playerid, 0xFFFFFF, "You successfully saved weapon to slot 1!");
SlotTaken = 1;
else
{
if(SlotTaken == 1)
{
SendClientMessage(playerid, 0xFFFFFF, "In this slot is weapon already saved!");
}
else if(listitem == 1)
{
SendClientMessage(playerid,0xFFFFFFFF,"Uložil jsi zbraт do slotu 2");
}
else if(listitem == 2)
{
SendClientMessage(playerid,0xFFFFFFFF,"Uložil jsi zbraт do slotu 3");
}
}
return true;
}
INI_Close (PouzivatelovSubor2);
ResetPlayerWeapons(playerid);
SendClientMessage(playerid, 0xFFFFFF, "You successfully saved weapon to slot 1!");
SlotTaken = 1;
ResetPlayerWeapons(playerid);
SendClientMessage(playerid, 0xFFFFFF, "You successfully saved weapon to slot 1!");
SlotTaken = 1;
if(SlotTaken == 1)
{
SendClientMessage(playerid, 0xFFFFFF, "In this slot is weapon already saved!");
}
else if(listitem == 1)
{
SendClientMessage(playerid,0xFFFFFFFF,"Uloћil jsi zbraт do slotu 2");
}
else if(listitem == 2)
{
SendClientMessage(playerid,0xFFFFFFFF,"Uloћil jsi zbraт do slotu 3");
}
return true;
}
I DONT BELIEVE! MY GOD!!!!! It works.. Thx mate alot!!
//EDIT: Well it compilled perfect, but got problem when I save weapon it still says SendClientMessage(playerid, 0xFFFFFF, "In this slot is weapon already saved!"); |
if(SlotTaken == 1)
{
SendClientMessage(playerid, 0xFFFFFF, "In this slot is weapon already saved!");
}
else if(SlotTaken == 2)
{
SendClientMessage(playerid,0xFFFFFFFF,"Uloћil jsi zbraт do slotu 2");
}
else if(SlotTaken == 3)
{
SendClientMessage(playerid,0xFFFFFFFF,"Uloћil jsi zbraт do slotu 3");
}