13.09.2009, 12:47
Код:
if(strcmp("/drag", cmdtext, true, 8) == 0) { if(IsPlayerInAnyVehicle(playerid)) { if (GetDistanceBetweenPlayers(playerid,giveplayerid) > 2.00) { SendClientMessage(playerid,COLOR_RED1,"You are too far away!!"); return 1; } if(PlayerData[playerid][Medic] < 2) return SendClientMessage(playerid, RED, "You are not a Medic rank2!"); tmp = strtok(cmdtext, idx); new otherplayer = strvalEx(tmp); if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /drag (playerid)"); new Float:X, Float:Y, Float:Z, Float:A; GetPlayerPos(playerid, X, Y, Z); GetPlayerFacingAngle(playerid, A); new pname[MAX_PLAYER_NAME],pname2[MAX_PLAYER_NAME]; GetPlayerName(otherplayer,pname,sizeof(pname)); GetPlayerName(playerid,pname2,sizeof(pname2)); format(string, sizeof(string), "Medic %s(%i) has draged you to his Vehicle!", pname2, playerid); SendClientMessage(otherplayer, TEAM_MEDIC, string); format(string, sizeof(string), "You dragged Player %s(%d) to your Vehicle!", pname, playerid); SendClientMessage(playerid, TEAM_MEDIC, string); new MyVehicle = CreateVehicle(417, X, Y, Z, A, 0, 0,0); PutPlayerInVehicle(playerid, MyVehicle, 2); } return 1; }