10.09.2010, 17:13
(
Последний раз редактировалось Karl1195; 10.09.2010 в 22:22.
)
I got a GF edit and i found another server GF edit and it got a nice roadblock and i would like to put it in my server and i am getting errors because they are different servers and they use different stuff example is
i don't know what to do with those shit stuff if some one can show me how to do it i will be very pleased thanks....
My server:
I WANT THIS WITH MINE!!
Karl1195.
Код:
if(IsPlayerConnected(playerid) && IsACop(playerid) || IsPlayerAdmin(playerid))
My server:
Код:
//--------------------------------=[Roadblock]=----------------------------------- if(strcmp(cmdtext, "/roadblock", true)==0 || strcmp(cmdtext, "/rb", true)==0) { if (PlayerInfo[playerid][pMember] != 1 && PlayerInfo[playerid][pLeader] != 1) return SendClientMessage(playerid, COLOR_GREY, "You are not a cop!"); if (PlayerInfo[playerid][pRoadblock] != 0) return SendClientMessage(playerid, COLOR_GREY, "You can only deploy 1 roadblock at a time, type /rrb to remove your existing one."); if (roadblocktimer != 0) return SendClientMessage(playerid, COLOR_GREY, "Please wait before trying to spawn another roadblock!"); new Float:X, Float:Y, Float:Z, Float:A; GetPlayerPos(playerid, X, Y, Z); GetPlayerFacingAngle(playerid, A); PlayerInfo[playerid][pRoadblock] = CreateObject(981, X, Y, Z, 0.0, 0.0, A+180); SetPlayerPos(playerid, X, Y, Z+4); GameTextForPlayer(playerid, "~w~Roadblock ~r~Placed", 5000, 5); SendClientMessage(playerid, COLOR_GREEN, "Roadblock deployed successfully, type /rrb or /roadunblock to remove it."); roadblocktimer = 1; GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "HQ: A roadblock has been deployed by %s, it has been marked on the map by a checkpoint.", sendername); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pMember] == 1 || PlayerInfo[i][pLeader] == 1) { SetPlayerCheckpoint(playerid, X, Y, Z-10, 1.0); SendClientMessage(i, TEAM_BLUE_COLOR, string); if (PlayerInfo[i][pRank] >= 5 && PlayerInfo[i][pMember] || PlayerInfo[i][pLeader] == 1) { SendClientMessage(i, COLOR_YELLOW, "You can remove all roadblocks by typing /rrball"); } } } } SetTimer("ResetRoadblockTimer", 60000, false); return 1; } if(strcmp(cmdtext, "/roadunblock", true)==0 || strcmp(cmdtext, "/rrb", true)==0) { if (PlayerInfo[playerid][pMember] != 1 && PlayerInfo[playerid][pLeader] != 1) { SendClientMessage(playerid, COLOR_GREY, "You are not a cop!"); return 1; } if (PlayerInfo[playerid][pRank] < 5) { SendClientMessage(playerid, COLOR_GREY, "You have to be rank 5 to use this command!"); return 1; } if (PlayerInfo[playerid][pRoadblock] == 0) { SendClientMessage(playerid, COLOR_GREY, "You haven't deployed a roadblock!"); return 1; } RemoveRoadblock(playerid); SendClientMessage(playerid, COLOR_GREEN, "Roadblock removed successfully."); return 1; } if(strcmp(cmdtext, "/roadunblockall", true)==0 || strcmp(cmdtext, "/rrball", true)==0) { if (PlayerInfo[playerid][pRank] >= 5 && PlayerInfo[playerid][pMember] || PlayerInfo[playerid][pLeader] == 1) { for(new i = 0; i < MAX_PLAYERS; i++) { if(PlayerInfo[i][pRoadblock] != 0) { RemoveRoadblock(i); } } GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "HQ: All roadblocks in the area are to be disbanded immediately by order of %s.", sendername); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pMember] == 1 || PlayerInfo[i][pLeader] == 1) { SendClientMessage(i, TEAM_BLUE_COLOR, string); } } } } else { SendClientMessage(playerid, COLOR_GREY, "You have to be rank 5+ or a police leader to remove all roadblocks!"); } return 1; }
Код:
//--------------------------------=[Roadblock]=----------------------------------- if(strcmp(cmd, "/crb", true) == 0 || strcmp(cmd, "/createroadblock", true) == 0) { if(IsPlayerConnected(playerid) && IsACop(playerid) || IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /crb [Roadblock ID]"); SendClientMessage(playerid, COLOR_LIGHTBLUE, "Available Roadblocks:"); SendClientMessage(playerid, COLOR_GRAD1, "| 1: Small Roadblock | 2: Medium Roadblock |"); SendClientMessage(playerid, COLOR_GRAD1, "| 3: Big Roadblock | 4: Cone | 5: Detour Sign |"); SendClientMessage(playerid, COLOR_GRAD1, "| 6: Will Be Sign | 7: Line Closed Sign |"); return 1; } new rb = strval(tmp); if (rb == 1) { PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); new Float:plocx,Float:plocy,Float:plocz,Float:ploca; GetPlayerPos(playerid, plocx, plocy, plocz); GetPlayerFacingAngle(playerid,ploca); CreateRoadblock(1459,plocx,plocy,plocz,ploca); format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(1) at his position, over.",sendername); SendRadioMessage(1,COLOR_BLUE,string); GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1); return 1; } else if (rb == 2) { PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); new Float:plocx,Float:plocy,Float:plocz,Float:ploca; GetPlayerPos(playerid, plocx, plocy, plocz); GetPlayerFacingAngle(playerid,ploca); CreateRoadblock(978,plocx,plocy,plocz+0.6,ploca); format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(2) at his position, over.",sendername); SendRadioMessage(1,COLOR_BLUE,string); GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1); return 1; } else if (rb == 3) { PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); new Float:plocx,Float:plocy,Float:plocz,Float:ploca; GetPlayerPos(playerid, plocx, plocy, plocz); GetPlayerFacingAngle(playerid,ploca); CreateRoadblock(981,plocx,plocy,plocz+0.9,ploca+180); format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(3) at his position, over.",sendername); SendRadioMessage(1,COLOR_BLUE,string); GameTextForPlayer(playerid,"~w~Roadblock ~g~Placed!",3000,1); SafeSetPlayerPos(playerid, plocx, plocy+1.3, plocz); return 1; } else if (rb == 4) { PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); new Float:plocx,Float:plocy,Float:plocz,Float:ploca; GetPlayerPos(playerid, plocx, plocy, plocz); GetPlayerFacingAngle(playerid,ploca); CreateRoadblock(1238,plocx,plocy,plocz+0.2,ploca); format(string,sizeof(string),"[HQ]: Officer %s has placed a Traffic Cone(1) at his position, over.",sendername); SendRadioMessage(1,COLOR_BLUE,string); GameTextForPlayer(playerid,"~w~Cone ~g~Placed!",3000,1); return 1; } else if (rb == 5) { PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); new Float:plocx,Float:plocy,Float:plocz,Float:ploca; GetPlayerPos(playerid, plocx, plocy, plocz); GetPlayerFacingAngle(playerid,ploca); CreateRoadblock(1425,plocx,plocy,plocz+0.6,ploca); format(string,sizeof(string),"[HQ]: Officer %s has placed a Detour Sign(4) at his position, over.",sendername); SendRadioMessage(1,COLOR_BLUE,string); GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1); return 1; } else if (rb == 6) { PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); new Float:plocx,Float:plocy,Float:plocz,Float:ploca; GetPlayerPos(playerid, plocx, plocy, plocz); GetPlayerFacingAngle(playerid,ploca); CreateRoadblock(3265,plocx,plocy,plocz-0.5,ploca); format(string,sizeof(string),"[HQ]: Officer %s has placed a Will Be Sign(5) at his position, over.",sendername); SendRadioMessage(1,COLOR_BLUE,string); GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1); return 1; } else if (rb == 7) { PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); new Float:plocx,Float:plocy,Float:plocz,Float:ploca; GetPlayerPos(playerid, plocx, plocy, plocz); GetPlayerFacingAngle(playerid,ploca); CreateRoadblock(3091,plocx,plocy,plocz+0.5,ploca+180); format(string,sizeof(string),"[HQ]: Officer %s has placed a Line Closed Sign(6) at his position, over.",sendername); SendRadioMessage(1,COLOR_BLUE,string); GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1); return 1; } new y, m, d; new h,mi,s; getdate(y,m,d); gettime(h,mi,s); format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /createroadblock %d",d,m,y,h,mi,s,sendername, rb); CommandLog(string); } return 1; } if (strcmp(cmd,"/rub",true) == 0 || strcmp(cmd, "/removeroadblock", true) == 0) { if(IsPlayerConnected(playerid) && IsACop(playerid) || PlayerInfo[playerid][pAdmin] >= 2) { DeleteClosestRoadblock(playerid); format(string,sizeof(string),"[HQ]: Officer %s has removed a Roadblock, over.",sendername); SendRadioMessage(1,COLOR_BLUE,string); GameTextForPlayer(playerid,"~w~Roadblock ~r~Removed!",3000,1); new y, m, d; new h,mi,s; getdate(y,m,d); gettime(h,mi,s); format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /removeroadblock",d,m,y,h,mi,s,sendername); CommandLog(string); } return 1; } if (strcmp(cmd,"/rrball",true) == 0 || strcmp(cmd, "/removeroadblockall", true) == 0) { if(IsPlayerConnected(playerid) && IsACop(playerid) || PlayerInfo[playerid][pAdmin] >= 2) { if(PlayerInfo[playerid][pRank] >= 5 || PlayerInfo[playerid][pAdmin] >= 2) // This being the default Chief rank in LA-RP change if neccesary. { DeleteAllRoadblocks(playerid); format(string,sizeof(string),"[HQ]: Officer %s has removed all Roadblocks in the area, over.",sendername); SendRadioMessage(1,COLOR_BLUE,string); GameTextForPlayer(playerid,"~b~All ~w~Roadblocks ~r~Removed!",3000,1); new y, m, d; new h,mi,s; getdate(y,m,d); gettime(h,mi,s); format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /removeroadblockall",d,m,y,h,mi,s,sendername); CommandLog(string); } } return 1; }