Hello all,
I am currently looking at the NoUnlock plugin
here and want a version where users can only use strange weapons. However, the following script only allow strange weapons and nothing else. I want to configure it so players can use strange weapons and cosmetics.
Here's the snippet:
PHP Code:
public OnPluginStart() {
CreateConVar("sm_tonlystrangepls_version", VERSION, "[TF2] tOnlyStrangePls", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
}
public TF2Items_OnGiveNamedItem_Post(client, String:classname[], iItemDefinitionIndex, itemLevel, itemQuality, entityIndex) {
if(itemQuality != QUALITY_STRANGE) {
new Handle:hTrie = CreateTrie();
SetTrieValue(hTrie, "client", client);
SetTrieValue(hTrie, "entityIndex", entityIndex);
CreateTimer(0.01, Timer_ReplaceWeapon, hTrie);
return;
}
}
public Action:Timer_ReplaceWeapon(Handle:timer, any:hTrie) {
new entityIndex = -1;
GetTrieValue(hTrie, "entityIndex", entityIndex);
new client = -1;
GetTrieValue(hTrie, "client", client);
CloseHandle(hTrie);
if(IsValidEntity(entityIndex)) {
RemovePlayerItem(client, entityIndex);
AcceptEntityInput(entityIndex, "Kill");
}
}