- เครดิต
- 5850
- ความรู้
-
- เงิน $
-
- ความดี
-
|
เนื่องจากมีคนขอมานะครับ
- if(strcmp(cmd, "/sban", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
-
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "Usage: /sban [playerid/PartOfName] [reason]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if (PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- if (PlayerInfo[playerid][pAdminLevel] >= 1 && PlayerInfo[playerid][pAdminLevel] < 1339)
- {
- if (PlayerInfo[giveplayerid][pAdminLevel] >= 1339 && PlayerInfo[giveplayerid][pAdminLevel] <= 9999)
- {
- SendClientMessage(playerid, COLOR_GRAD2, " คุณไม่สามารถแบนแอดมินใหญ่ได้ !!");
- return 1;
- }
- }
- if (PlayerInfo[playerid][pAdminLevel] >= 1339 && PlayerInfo[playerid][pAdminLevel] <= 9998)
- {
- if (PlayerInfo[giveplayerid][pAdminLevel] == 9999)
- {
- return 1;
- }
- }
- if(IsPlayerNPC(giveplayerid))
- {
- SendClientMessage(playerid, COLOR_GRAD2, " คุณไม่สามารถแบน NPC ได้");
- return 1;
- }
-
- if(IsPlayerConnected(giveplayerid))
-
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[64];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "Usage: /sban [playerid/PartOfName] [reason]");
- return 1;
- }
- new year, month,day;
- getdate(year, month, day);
- new hour,minutes,secondss;
- gettime(hour,minutes,secondss);
- format(string, sizeof(string), "AdmCmd: %s ได้ถูกแบนเงียบโดย %s สาเหตุ: %s (%d/%d/%d %d:%d)", giveplayer, sendername, (result), year, month, day, hour, minutes);
- BanLog(string);
- SendAdminMessage(COLOR_SYSTEM, string);
- PlayerInfo[giveplayerid][pBanned] = 1;
- Kick(giveplayerid);
- return 1;
- }
- }//not connected
- }
- else
- {
- format(string, sizeof(string), " %d is not an active player.", giveplayerid);
- SendClientMessage(playerid, COLOR_GRAD1, string);
- }
- }
- return 1;
- }
คัดลอกไปที่คลิปบอร์ด
|
|