heyho,
bei meinem befehl klappt nun wieder etwas nicht. ich kann mir zwar eine waffe mit der anzahl munition holen, und die mats werden auch korrekt abgenommen etc, aber ich kann mir immer nur eine ak47 holen, keine deagle oder so
if(!strcmp(strget(cmdtext,0),"/nehmwaffe"))
{
if(PlayerInfo[playerid][Terror] == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, -728.1709,1545.3650,39.0132))
{
new ammo = strval(strget(cmdtext,2));
new gun = strval(strget(cmdtext,1));
new ammocharge;
new gunid[16];
if(strcmp(gunid, "ak47", true, strlen(gunid)) == 0)
{
gun = 30 ; ammocharge = 5*ammo ;
}
else if(strcmp(gunid, "schaufel", true, strlen(gunid)) == 0)
{
gun = 6 ; ammocharge = 30 ;
}
else if(strcmp(gunid, "deagle", true, strlen(gunid)) == 0)
{
gun = 24 ; ammocharge = 2*ammo ;
}
else if(strcmp(gunid, "shotgun", true, strlen(gunid)) == 0)
{
gun = 25 ; ammocharge = 3*ammo ;
}
else if(strcmp(gunid, "mp5", true, strlen(gunid)) == 0)
{
gun = 29 ; ammocharge = 3*ammo ;
}
else if(strcmp(gunid, "rifle", true, strlen(gunid)) == 0)
{
gun = 33 ; ammocharge = 7*ammo ;
}
else if(strcmp(gunid, "raketenwerfer", true, strlen(gunid)) == 0)
{
gun = 24 ; ammocharge = 150*ammo ;
}
{
if(PlayerInfo[playerid][Mats] < ammocharge) return SendClientMessage(playerid, 0xFFFFFF, "Nicht genug Mats!");
{
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
GivePlayerWeapon(playerid, gun, ammo);
PlayerInfo[playerid][Mats] -= ammocharge;
}
}
}
}
return 1;
}
{
if(PlayerInfo[playerid][Terror] == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, -728.1709,1545.3650,39.0132))
{
new ammo = strval(strget(cmdtext,2));
new gun = strval(strget(cmdtext,1));
new ammocharge;
new gunid[16];
if(strcmp(gunid, "ak47", true, strlen(gunid)) == 0)
{
gun = 30 ; ammocharge = 5*ammo ;
}
else if(strcmp(gunid, "schaufel", true, strlen(gunid)) == 0)
{
gun = 6 ; ammocharge = 30 ;
}
else if(strcmp(gunid, "deagle", true, strlen(gunid)) == 0)
{
gun = 24 ; ammocharge = 2*ammo ;
}
else if(strcmp(gunid, "shotgun", true, strlen(gunid)) == 0)
{
gun = 25 ; ammocharge = 3*ammo ;
}
else if(strcmp(gunid, "mp5", true, strlen(gunid)) == 0)
{
gun = 29 ; ammocharge = 3*ammo ;
}
else if(strcmp(gunid, "rifle", true, strlen(gunid)) == 0)
{
gun = 33 ; ammocharge = 7*ammo ;
}
else if(strcmp(gunid, "raketenwerfer", true, strlen(gunid)) == 0)
{
gun = 24 ; ammocharge = 150*ammo ;
}
{
if(PlayerInfo[playerid][Mats] < ammocharge) return SendClientMessage(playerid, 0xFFFFFF, "Nicht genug Mats!");
{
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
GivePlayerWeapon(playerid, gun, ammo);
PlayerInfo[playerid][Mats] -= ammocharge;
}
}
}
}
return 1;
}
hoffe mir kann einer helfen