25.03.2013, 10:02
before i make the player trusted player he can u tp cmds.but after making him tp he cant use what the heck is that pls fix it
Код:
#include <a_samp> #include <YSI\y_ini> #include <sscanf2> #include <zcmd> enum pInfo { pWarns, AdminLevel, pPass, pCash, pLevel, pSkin, pInt, pVW, pAdmin, pSecKey, pKills, pDeaths, Float:FacingAngle, Float:Health, Float:Armour, Float:LastX, Float:LastY, Float:LastZ, bool:Jailed, pTrustedPlayerLevel, } new PlayerInfo[MAX_PLAYERS][pInfo]; static CountTimer; static countamount; static iscountactivated; main() { print("Hi"); } public OnGameModeInit() { return 1; } public OnGameModeExit() { return 1; } #define COLOR_BITEM 0xE1B0B0FF #define COLOR_GRAD1 0xB4B5B7FF #define COLOR_GRAD2 0xBFC0C2FF #define COLOR_GRAD3 0xCBCCCEFF #define COLOR_GRAD4 0xD8D8D8FF #define COLOR_GRAD5 0xE3E3E3FF #define COLOR_GRAD6 0xF0F0F0FF #define COLOR_GREY 0xAFAFAFAA #define COLOR_GREEN 0x33AA33AA #define COLOR_RED 0xAA3333AA #define COLOR_BLACK 0x000001FF #define COLOR_BLUE 0x007BD0FF #define COLOR_LIGHTORANGE 0xFFA100FF #define COLOR_FLASH 0xFF000080 #define COLOR_LIGHTRED 0xFF6347AA #define COLOR_LIGHTBLUE 0x33CCFFAA #define COLOR_LIGHTGREEN 0x9ACD32AA #define COLOR_YELLOW 0xFFFF00AA #define COLOR_LIGHTYELLOW 0xFFFF91FF #define COLOR_YELLOW2 0xF5DEB3AA #define COLOR_WHITE 0xFFFFFFAA #define COLOR_FADE1 0xE6E6E6E6 #define COLOR_FADE2 0xC8C8C8C8 #define COLOR_FADE3 0xAAAAAAAA #define COLOR_FADE4 0x8C8C8C8C #define COLOR_FADE5 0x6E6E6E6E #define COLOR_PURPLE 0xC2A2DAAA #define COLOR_DBLUE 0x2641FEAA #define COLOR_DOC 0xFF8282AA #define COLOR_DCHAT 0xF0CC00FF #define COLOR_NEWS 0xFFA500AA #define COLOR_OOC 0xE0FFFFAA #define TEAM_BLUE_COLOR 0x8D8DFF00 #define TEAM_GROVE_COLOR 0x00AA00FF #define TEAM_AZTECAS_COLOR 0x01FCFFC8 #define NEWBIE_COLOR 0x7DAEFFFF #define SAMP_COLOR 0xAAC4E5FF #define blue 0x2641FEAA public OnPlayerRequestClass(playerid, classid) { SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746); return 1; } public OnPlayerConnect(playerid) { return 1; } public OnPlayerDisconnect(playerid, reason) { return 1; } public OnPlayerSpawn(playerid) { return 1; } public OnPlayerDeath(playerid, killerid, reason) { return 1; } public OnVehicleSpawn(vehicleid) { return 1; } public OnVehicleDeath(vehicleid, killerid) { return 1; } public OnPlayerText(playerid, text[]) { return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/mycommand", cmdtext, true, 10) == 0) { // Do something here return 1; } return 0; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { return 1; } public OnPlayerExitVehicle(playerid, vehicleid) { return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { return 1; } public OnPlayerEnterCheckpoint(playerid) { return 1; } public OnPlayerLeaveCheckpoint(playerid) { return 1; } public OnPlayerEnterRaceCheckpoint(playerid) { return 1; } public OnPlayerLeaveRaceCheckpoint(playerid) { return 1; } public OnRconCommand(cmd[]) { return 1; } public OnPlayerRequestSpawn(playerid) { return 1; } public OnObjectMoved(objectid) { return 1; } public OnPlayerObjectMoved(playerid, objectid) { return 1; } public OnPlayerPickUpPickup(playerid, pickupid) { return 1; } public OnVehicleMod(playerid, vehicleid, componentid) { return 1; } public OnVehiclePaintjob(playerid, vehicleid, paintjobid) { return 1; } public OnVehicleRespray(playerid, vehicleid, color1, color2) { return 1; } public OnPlayerSelectedMenuRow(playerid, row) { return 1; } public OnPlayerExitedMenu(playerid) { return 1; } public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) { return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { return 1; } public OnRconLoginAttempt(ip[], password[], success) { return 1; } public OnPlayerUpdate(playerid) { return 1; } public OnPlayerStreamIn(playerid, forplayerid) { return 1; } public OnPlayerStreamOut(playerid, forplayerid) { return 1; } public OnVehicleStreamIn(vehicleid, forplayerid) { return 1; } public OnVehicleStreamOut(vehicleid, forplayerid) { return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { return 1; } public OnPlayerClickPlayer(playerid, clickedplayerid, source) { return 1; } stock getName(playerid) { new szName[MAX_PLAYER_NAME]; GetPlayerName(playerid, szName, sizeof(szName)); return szName; } CMD:maketrustedplayer(playerid, params[]) { new iID, iLevel; if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You Are Not rcon log in"); if(sscanf(params, "ud", iID, iLevel)) return SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /maketrustedplayer [nick/id] [level 1-2]"); if(iLevel < 1 || iLevel > 2) return SendClientMessage(playerid, COLOR_RED, "Invalid level specified. Valid level's are 1 through 2."); new szString[128]; format(szString, sizeof(szString), "%s has made you Trusted Player!", getName(playerid)); SendClientMessage(iID, COLOR_GREEN, szString); format(szString, sizeof(szString), "You have given Trusted Player rank to %s!", getName(iID)); SendClientMessage(playerid, COLOR_RED, szString); PlayerInfo[iID][pTrustedPlayerLevel] = iLevel; return 1; } CMD:count(playerid,params[]) { new iID; if( PlayerInfo[iID][pTrustedPlayerLevel] >= 1)return ShowPlayerDialog(playerid,0, DIALOG_STYLE_MSGBOX,"ERROR:","YOU ARE NOT TRUSTED PLAYER.APPLY IN OUR FORUM(www.wttdm.tk)TO BE TRUSTED PLAYER ","Ok",""); static amount;//creating the variable, where it will store the amount, that the player chose. if(sscanf(params,"i",amount)) return SendClientMessage(playerid,-1,"USAGE: /count <amount>");//checking if the player inputs any params, and if its an integer. if(iscountactivated == 1) return SendClientMessage(playerid,-1,"The countdown is already activated!");//Checking if someone already started a countdown. if(amount > 10 || amount <= 0) return SendClientMessage(playerid,-1,"The amount can't be greater than 10");//Checking if the amount is higher than 10, so therefor the player can't spam/annoy other players. CountTimer = SetTimer("Count",1000,true);//Setting the timer, for the count down. countamount = amount;//Setting the variable countamount to the inputted amount. iscountactivated = 1;//Setting the iscountactivated to 1 to prevent future spam. return 1; } forward Count(); public Count() { if(!iscountactivated) { KillTimer(CountTimer); }//Checking if the timer is activated, if not kill the timer. else { new string[4];//Creating the string variable, where we will store the count down value. format(string,sizeof(string),"%i",countamount);//Formating it. GameTextForAll(string,1000,3);//Showing it to everyone. countamount--;//Counting less 1 to the count down variable. } if(countamount == -1) { iscountactivated = 0; GameTextForAll("~g~~h~Go!",1000,3); } return 1; } CMD:hydra(playerid,params[]) { new iID; if( PlayerInfo[iID][pTrustedPlayerLevel] >= 1)return ShowPlayerDialog(playerid,0, DIALOG_STYLE_MSGBOX,"ERROR:","YOU ARE NOT TRUSTED PLAYER.APPLY IN OUR FORUM(www.wttdm.tk)TO BE TRUSTED PLAYER ","Ok",""); { new Float:X,Float:Y,Float:Z,MyHydra; GetPlayerPos(playerid, X, Y, Z); MyHydra = CreateVehicle(520, X,Y,Z, 0.0, 0, 0, 10); PutPlayerInVehicle(playerid, MyHydra, 0); } return 1; } CMD:hunter(playerid,params[]) { new iID; if( PlayerInfo[iID][pTrustedPlayerLevel] >= 1)return ShowPlayerDialog(playerid,0, DIALOG_STYLE_MSGBOX,"ERROR:","YOU ARE NOT TRUSTED PLAYER.APPLY IN OUR FORUM(www.wttdm.tk)TO BE TRUSTED PLAYER ","Ok",""); { if (IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "You are in a vehicle"); { new Float:X,Float:Y,Float:Z,MyHunter; GetPlayerPos(playerid, X, Y, Z); MyHunter = CreateVehicle(425, X,Y,Z, 0.0, 0, 0, 10); PutPlayerInVehicle(playerid, MyHunter, 0); } } return 1; }