Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Action:SetCreditos(client, args)
- {
- if(client == 0)
- {
- PrintToServer("%t","Command is in-game only");
- return Plugin_Handled;
- }
- if(args < 2) // Not enough parameters
- {
- ReplyToCommand(client, "[SM] Use: sm_give <#userid|name> [amount]");
- return Plugin_Handled;
- }
- decl String:arg2[10];
- GetCmdArg(2, arg2, sizeof(arg2));
- new amount = StringToInt(arg2);
- decl String:strTarget[32]; GetCmdArg(1, strTarget, sizeof(strTarget));
- decl String:strTargetName[MAX_TARGET_LENGTH];
- decl TargetList[MAXPLAYERS], TargetCount;
- decl bool:TargetTranslate;
- if ((TargetCount = ProcessTargetString(strTarget, client, TargetList, MAXPLAYERS, COMMAND_FILTER_CONNECTED,
- strTargetName, sizeof(strTargetName), TargetTranslate)) <= 0)
- {
- ReplyToTargetError(client, TargetCount);
- return Plugin_Handled;
- }
- for (new i = 0; i < TargetCount; i++)
- {
- new iClient = TargetList[i];
- if (IsClientInGame(iClient))
- {
- g_iCreditos[iClient] += amount;
- PrintToChat(client, "[ SHOP ] Give \x03%i \x01credits for player: %N", amount, iClient);
- }
- }
- return Plugin_Continue;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement