10.03.2012, 14:49
What is wrong with this 2 commands, it compiles just nothing happens ingame?
&
Код:
CMD:gethere(playerid,params[]) { if(PInfo[playerid][Level] < 2) { new id,Float:X,Float:Y,Float:Z, pname[MAX_PLAYER_NAME], string[126], name[MAX_PLAYER_NAME]; if(sscanf(params, "u",id)) return SendClientMessage(playerid,RED,"Command format: /akill (playername/id) (reason)"); if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,RED, "Error: Player is not connected!"); if(id == playerid) return SendClientMessage(playerid,RED, "Error: You cannot get yourself!"); new vWorld = GetPlayerVirtualWorld(playerid); SetPlayerVirtualWorld(id,vWorld); new Interior = GetPlayerInterior(playerid); SetPlayerInterior(id,Interior); SetPlayerVirtualWorld(id,GetPlayerVirtualWorld(playerid)); GetPlayerPos(playerid,X,Y,Z); if(GetPlayerState(playerid) == 2) { SetVehiclePos(GetPlayerVehicleID(id),X+3,Y,Z); LinkVehicleToInterior(GetPlayerVehicleID(id),GetPlayerInterior(playerid)); SetVehicleVirtualWorld(GetPlayerVehicleID(id),GetPlayerVirtualWorld(playerid)); } else SetPlayerPos(id,X+2,Y,Z); GetPlayerName(playerid, pname, sizeof(pname)); GetPlayerName(id, name, sizeof(name)); format(string,sizeof(string),"Administrator %s(ID:%d) has teleported you to his/her position",Name(playerid), playerid); SendClientMessage(id,GREEN,string); format(string,sizeof(string),"You teleport %s(ID:%d) to your position", name, id); SendClientMessage(playerid,GREEN,string); } return 1; }
Код:
CMD:slap(playerid, params[]) { new Float:x, Float:y, Float:z,Float:health; new string[128], pname[MAX_PLAYER_NAME], victimname[MAX_PLAYER_NAME], victimid, reason[30]; if(PlayerInfo[playerid][Admin] > 1) { if(sscanf(params, "us[30]", victimid, reason)) return SendClientMessage(playerid, COLOR_RED, "SYNTAX: /slap <playerid/name> <reason>"); if(victimid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid-Playerid!"); if(victimid == playerid) return SendClientMessage(playerid, COLOR_RED, "You cannot slap yourself!"); GetPlayerPos(victimid, x, y, z); GetPlayerName(playerid, pname, sizeof(pname)); GetPlayerName(victimid, victimname, sizeof(victimname)); GetPlayerHealth(victimid, health); SetPlayerHealth(victimid, health-25); SetPlayerPos(victimid, x, y, z+5); format(string, sizeof(string), "%s(ID:%d) has been slap by Administrator %s(ID:%d) | Reason: %s", victimname, victimid, pname, playerid, reason); SendClientMessageToAll(COLOR_RED, string); format(string, sizeof(string), "You slap %s(ID:%d) | Reason: %s", victimname, victimid, reason); SendClientMessage(playerid, COLOR_RED, string); format(string, sizeof(string), "You have been slap by Administrator %s(ID:%d) | Reason: %s", pname, playerid, reason); SendClientMessage(victimid, COLOR_RED, string); PlayerPlaySound(playerid, 1190, 0.0, 0.0, 0.0); PlayerPlaySound(victimid, 1190, 0.0, 0.0, 0.0); } return 1;