Wie kann es scripten das z.b man /gungame eingibt man spawnt mit ner pistol wenn man jemand killt bekommt man ne andere Waffe bis wenn man ein Messer bekommt.
Ich habe es versucht aber bei mir buggt es code:
Problem ist man bekommt die Waffen nicht bzw es failt alles oder der gestorbene bekommt keine Waffe
oben im Script
new gungame[MAX_PLAYERS];new gungameplayer[MAX_PLAYERS];
OnPlayerDeath:
if(gungame[playerid] == 1)
{
gungame[playerid] --;
gungame[killerid] ++;
switch(gungame[killerid])
{
case 1:
{
ResetPlayerWeapons(killerid);
GivePlayerWeapon(killerid,34,1337);
}
case 2:
{
ResetPlayerWeapons(killerid);
GivePlayerWeapon(killerid,26,1337);
}
case 3:
{
ResetPlayerWeapons(killerid);
GivePlayerWeapon(killerid,28,1337);
}
case 4:
{
ResetPlayerWeapons(killerid);
GivePlayerWeapon(killerid,29,1337);
}
case 5:
{
ResetPlayerWeapons(killerid);
GivePlayerWeapon(killerid,30,1337);
}
case 6:
{
ResetPlayerWeapons(killerid);
GivePlayerWeapon(killerid,9,1337);
}
case 7:
{
ResetPlayerWeapons(killerid);
GivePlayerWeapon(killerid,22,1337);
}
case 8:
{
ResetPlayerWeapons(killerid);
GivePlayerWeapon(killerid,27,1337);
}
case 9:
{
ResetPlayerWeapons(killerid);
GivePlayerWeapon(killerid,32,1337);
}
case 10:
{
ResetPlayerWeapons(killerid);
GivePlayerWeapon(killerid,27,1337);
}
case 11:
{
ResetPlayerWeapons(killerid);
GivePlayerWeapon(killerid,4,1337);
}
case 12:
{
for(new i = 0; MAX_PLAYERS< i; i++)
{
ResetPlayerWeapons(i);
SpawnPlayer(i);
gungame = 0;
}
}
}
Befehl:
ocmd:gungame(playerid,params[])
{
new str[128];
if(Map[playerid] == 0)
{
if(gungame[playerid] == 1) return SendClientMessage(playerid,GRAU,"Die Runde hat schon angefangen");
format(str,sizeof(str),"[ARENA] %s hat die /gungame Arena betreten!",SpielerName(playerid));
SendClientMessageToAll(COLOR_GREEN,str);
SetPlayerPos(playerid,384.808624,173.804992,1008.382812);
SetPlayerInterior(playerid,3);
ResetPlayerWeapons(playerid);
SetPlayerHealth(playerid,100);
GivePlayerWeapon(playerid,23,1337);
Map[playerid] = 1;
gungameplayer[playerid] ++;
gungameplayer[playerid] = 1;
TogglePlayerControllable(playerid,0);
SetTimer("gungametimer",30000,false);
}
else
{
SendClientMessage(playerid,GRAU,"Du bist schon in einer Arena. Benutze /l");
}
return 1;
}