I am trying to make a plugin that applies skin to every gun taken from floor by giving them with giveplayeritem
(aim_redline in guns in the floor has no skin.i can make 2 ifs giveplayeritem(client,"weapon_m4a1") giveplayeritem(client,"weapon_ak47") but in general it doesn't work without if ing every gun)
Code:
#include <sourcemod>
#include <sdktools>
#include <cstrike>
public OnPluginStart()
{
HookEvent("item_pickup", Event_OnItemPickup);
}
int aldi = 0;
public Event_OnItemPickup(Handle:event, const String:name[], bool:dontBroadcast)
{
if(aldi==1){
aldi = 0;
return;
}
new client = GetClientOfUserId(GetEventInt( event, "userid"));
decl String:sItem[100];
GetEventString(event, "item", sItem, sizeof(sItem));
//PrintToChatAll("%s", sItem);
new silah = GetPlayerWeaponSlot(client, CS_SLOT_PRIMARY);
PrintToChatAll("silah1: %s", sItem);
if(silah != -1){
RemovePlayerItem(client, silah);
}
char silah2[256]
Format(silah2, sizeof(silah2), "weapon_%s", sItem);
PrintToChatAll("silah2: %s", silah2);
//GivePlayerItem(client,silah2);//--------what should i do here
aldi = 1;
}
it says argument type mismatch
__________________