- เครดิต
- 321
- ความรู้
-
- เงิน $
-
- ความดี
-
|
ลองนำไปปรับแต่งเองนะครับ เช่น ใครสามารถใช้คำสั่งนี้ได้บ้าง
อันนี้เป็นคำสั่งส่อง /recon , /tv- if(strcmp(cmd, "/tv", true) == 0 || strcmp(cmd, "/recon", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerInfo[playerid][pDonateRank] > 0 || PlayerInfo[playerid][pAdmin] >= 1)
- {
- if(WatchingTV[playerid] < 1)
- {
- GetPlayerPos(playerid, Unspec[playerid][Coords][0],Unspec[playerid][Coords][1],Unspec[playerid][Coords][2]);
- }
- }
- new hkey = PlayerInfo[playerid][pPhousekey];
- new house = PlayerInfo[playerid][pLocal];
- if(Spectate[playerid] == 255 && PlayerInfo[playerid][pLocal] != 255 || Spectate[playerid] == 255 && PlayerInfo[playerid][pAdmin] > 0)
- {
- GetPlayerPos(playerid, Unspec[playerid][sPx], Unspec[playerid][sPy], Unspec[playerid][sPz]);
- Unspec[playerid][sPint] = PlayerInfo[playerid][pInt];
- Unspec[playerid][sLocal] = PlayerInfo[playerid][pLocal];
- PlayerInfo[playerid][pLocal] = 255;
- gTeam[playerid] = 0;
- }
- tmp = strtok(cmdtext, idx);
- if(strcmp("off", tmp, true, strlen(tmp)) == 0)
- {
- if(WatchingTV[playerid] > 0)
- {
- WatchingTV[playerid] = 0;
- Spectate[playerid] = 253;
- GameTextForPlayer(playerid, "~w~ TV~n~~r~ Off", 5000, 6);
- PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, " You are not watching TV !");
- return 1;
- }
- }
- if(PlayerInfo[playerid][pAdmin] < 1)
- {
- if(house == 255)
- {
- GameTextForPlayer(playerid, "~r~There is no tv here", 5000, 1);
- return 1;
- }
- }
- if(PlayerInfo[playerid][pAdmin] > 1 || PlayerToPoint(12.0, playerid, HouseInfo[hkey][hExitx], HouseInfo[hkey][hExity],HouseInfo[hkey][hExitz]))
- {
- if(HouseInfo[hkey][hHealthx] != 1)
- {
- GameTextForPlayer(playerid, "~r~This upgrade isn't installed", 5000, 1);
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- Spectate[playerid] = giveplayerid;
- new Float:health;
- GetPlayerHealth(Spectate[playerid], health);
- GetPlayerName(Spectate[playerid], giveplayer, sizeof(giveplayer));
- new cash = GetPlayerMoney(Spectate[playerid]);
- if (PlayerInfo[playerid][pAdmin] >= 1)
- {
- format(string, sizeof(string), "Recon: (%d) %s $%d H:%.0f",Spectate[playerid],giveplayer,cash,health);
- }
- else
- {
- format(string, sizeof(string), "UAV: (%d) %s",Spectate[playerid],giveplayer);
- }
- SendClientMessage(playerid, COLOR_GREEN, string);
- WatchingTV[playerid] = 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREEN, "Target is not available.");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREEN, " You are not in your House !");
- return 1;
- }
- }
- return 1;
- }
คัดลอกไปที่คลิปบอร์ด แถมคำสั่งเล็กๆน้อยๆให้ครับ- if(strcmp(cmd, "/uncon", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- SetCamBack(playerid);
- }
- return 1;
- }
คัดลอกไปที่คลิปบอร์ด |
|