- เครดิต
- 142
- ความรู้
-
- เงิน $
-
- ความดี
-
|
if (strcmp(cmdtext,"/วางตะปู",true) == 0)
{
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1
|| PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2
|| PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3
|| PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17
|| PlayerInfo[playerid][pMember] == 28 || PlayerInfo[playerid][pLeader] == 28
|| PlayerInfo[playerid][pMember] == 33 || PlayerInfo[playerid][pLeader] == 33
|| PlayerInfo[playerid][pMember] == 34 || PlayerInfo[playerid][pLeader] == 34
|| PlayerInfo[playerid][pMember] == 44 || PlayerInfo[playerid][pLeader] == 44
|| PlayerInfo[playerid][pMember] == 46 || PlayerInfo[playerid][pLeader] == 46
|| PlayerInfo[playerid][pMember] == 47 || PlayerInfo[playerid][pLeader] == 47)
{
if (PlayerInfo[playerid][pRank] < 3)
{
SendClientMessage(playerid, COLOR_GREY, " ต้องมียศมากกว่า 3 หรือมากกว่า !");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid,COLOR_GREY," คุณต้องไม่อยู่ในรถ !");
return 1;
}
new spike;
for(new i = 0; i < sizeof(SpikeInfo); i++)
{
if(SpikeInfo[i][sCreated] == 1)
{
spike++;
}
}
if(spike >= 5)
{
SendClientMessage(playerid, COLOR_GREY, " สามารถวางได้ไม่เกิน 5 อัน /เก็บตะปูทั้งหมด เพื่อเก็บทั้งหมด !");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
GetPlayerPos(playerid, plocx, plocy, plocz);
GetPlayerFacingAngle(playerid,ploca);
CreateStrip(plocx,plocy,plocz,ploca);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s(%d) ได้วางตะปูเรือใบไว้ที่ไหนสักแห่ง", sendername, playerid);
OOCOff(COLOR_WHITE,string);
}
return 1;
}
if (strcmp(cmdtext,"/เก็บตะปู",true) == 0)
{
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1
|| PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2
|| PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3
|| PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17
|| PlayerInfo[playerid][pMember] == 28 || PlayerInfo[playerid][pLeader] == 28
|| PlayerInfo[playerid][pMember] == 33 || PlayerInfo[playerid][pLeader] == 33
|| PlayerInfo[playerid][pMember] == 34 || PlayerInfo[playerid][pLeader] == 34
|| PlayerInfo[playerid][pMember] == 44 || PlayerInfo[playerid][pLeader] == 44
|| PlayerInfo[playerid][pMember] == 46 || PlayerInfo[playerid][pLeader] == 46
|| PlayerInfo[playerid][pMember] == 47 || PlayerInfo[playerid][pLeader] == 47)
{
if (PlayerInfo[playerid][pRank] < 3)
{
SendClientMessage(playerid, COLOR_GREY, " ต้องมียศมากกว่า 3 หรือมากกว่า !");
return 1;
}
new removestrip = 0;
if(DeleteClosestStrip(playerid))
{
removestrip = 1;
}
if(removestrip == 0)
{
SendClientMessage(playerid, COLOR_GREY, " ไม่มีตะปูเรือใบที่อยู่ใกล้ๆ ให้เก็บ !");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Dispatch: คุณ %s(%d) ได้เก็บตะปูเรือใบ", sendername,playerid);
SendTeamMessage(2, TEAM_BLUE_COLOR, string);
}
return 1;
} |
|