Guten Tag, liebes Breadfish Forum.
Ich bin derzeit an einem TDM Script am arbeiten (Selfmade) und habe ein Problem bei der Waffen vergabe.
Wenn man sich eine Klasse auswählt, soll man mit verschiedenen Waffen spawnen.
Wir haben mehrere Klassen, z.B Assault oder Destroyer.
if(GunInfo[playerid] == 1)//Assault
{
GivePlayerWeapon(playerid,24,100);
GivePlayerWeapon(playerid,29,300);
GivePlayerWeapon(playerid,31,300);
GivePlayerWeapon(playerid,16,3);
return 1;
}
if(GunInfo[playerid] == 2)//Destroy
{
GivePlayerWeapon(playerid,24,100);
GivePlayerWeapon(playerid,27,100);
GivePlayerWeapon(playerid,29,300);
GivePlayerWeapon(playerid,16,3);
return 1;
}
if(GunInfo[playerid] == 3)//Sniper
{
GivePlayerWeapon(playerid,24,100);
GivePlayerWeapon(playerid,34,50);
GivePlayerWeapon(playerid,29,300);
GivePlayerWeapon(playerid,16,3);
return 1;
}
if(GunInfo[playerid] == 4)
{
GivePlayerWeapon(playerid,24,100);
GivePlayerWeapon(playerid,35,5);
GivePlayerWeapon(playerid,29,150);
return 1;
}
GunInfo verändert sich wenn man nen Skin wechselt bei OnPlayerRequestClass:
if(Spieler[playerid][Eingeloggt] == 1)
{
switch(classid)
{
case 0://Anti-Terror
{
ClearPlayerChat(playerid);
GameTextForPlayer(playerid,"~b~Counter-Terrorists",1000,4);
SendClientMessage(playerid,COLOR_BLUE,"|____ Equip-Assault ____|");
SendClientMessage(playerid,COLOR_WHITE,"Desert Eagle - 100 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"MP5 - 300 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"M4 - 300 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"Grenades - 3");
GunInfo[playerid] = 1;
SetPlayerTeam(playerid,1);
}
case 1:
{
ClearPlayerChat(playerid);
GameTextForPlayer(playerid,"~b~Counter-Terrorists",1000,4);
SendClientMessage(playerid,COLOR_BLUE,"|____ Equip-Destroyer ____|");
SendClientMessage(playerid,COLOR_WHITE,"Desert Eagle - 100 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"Combat Shotgun - 100 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"MP5 - 300 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"Grenades - 3");
SetPlayerTeam(playerid,1);
GunInfo[playerid] = 2;
}
case 2:
{
ClearPlayerChat(playerid);
GameTextForPlayer(playerid,"~b~Counter-Terrorists",1000,4);
SendClientMessage(playerid,COLOR_BLUE,"|____ Equip-Sniper ____|");
SendClientMessage(playerid,COLOR_WHITE,"Desert Eagle - 100 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"Sniper - 50 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"MP5 - 300 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"Grenades - 3");
SetPlayerTeam(playerid,1);
GunInfo[playerid] = 3;
}
case 3:
{
ClearPlayerChat(playerid);
GameTextForPlayer(playerid,"~b~Counter-Terrorists",1000,4);
SendClientMessage(playerid,COLOR_BLUE,"|____ Equip-Heavy Trooper ____|");
SendClientMessage(playerid,COLOR_WHITE,"Desert Eagle - 100 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"Rocket Launcher - 5 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"MP5 - 300 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"Grenades - 3");
SetPlayerTeam(playerid,1);
GunInfo[playerid] = 4;
}
case 4://Terror
{
ClearPlayerChat(playerid);
GameTextForPlayer(playerid,"~r~Terrorists",1000,4);
SendClientMessage(playerid,COLOR_BLUE,"|____ Equip-Assault ____|");
SendClientMessage(playerid,COLOR_WHITE,"Desert Eagle - 100 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"MP5 - 300 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"M4 - 300 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"Grenades - 3");
SetPlayerTeam(playerid,2);
GunInfo[playerid] = 1;
}
case 5:
{
ClearPlayerChat(playerid);
GameTextForPlayer(playerid,"~r~Terrorists",1000,4);
SendClientMessage(playerid,COLOR_BLUE,"|____ Equip-Destroyer ____|");
SendClientMessage(playerid,COLOR_WHITE,"Desert Eagle - 100 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"Combat Shotgun - 100 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"MP5 - 300 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"Grenades - 3");
SetPlayerTeam(playerid,2);
GunInfo[playerid] = 2;
}
case 6:
{
ClearPlayerChat(playerid);
GameTextForPlayer(playerid,"~r~Terrorists",1000,4);
SendClientMessage(playerid,COLOR_BLUE,"|____ Equip-Sniper ____|");
SendClientMessage(playerid,COLOR_WHITE,"Desert Eagle - 100 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"Sniper - 50 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"MP5 - 300 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"Grenades - 3");
SetPlayerTeam(playerid,2);
GunInfo[playerid] = 3;
}
case 7:
{
ClearPlayerChat(playerid);
GameTextForPlayer(playerid,"~r~Terrorists",1000,4);
SendClientMessage(playerid,COLOR_BLUE,"|____ Equip-Heavy Trooper ____|");
SendClientMessage(playerid,COLOR_WHITE,"Desert Eagle - 100 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"Rocket Launcher - 5 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"MP5 - 300 Ammo");
SendClientMessage(playerid,COLOR_WHITE,"Grenades - 3");
SetPlayerTeam(playerid,2);
GunInfo[playerid] = 4;
}
}
Nur beim Spawn erhält man leider keine Waffen deshalb wollte ich fragen ob ihr mir dabei helfen könnt?
Nicht wundern, ist eine Englische Gamemode.