16.05.2013, 11:12
Can anyone give me a gotopos command for admin level 1? made with zcmd if possible please ?!
if(strcmp(cmd, "/gotols", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 2)
{
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, 1529.6,-1691.2,13.3);
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
}
else
{
SetPlayerPos(playerid, 1529.6,-1691.2,13.3);
}
SendClientMessage(playerid, COLOR_GRAD1, ""#GAlbastru"[Suceava-RPG]: {ffd700}Ai fost Teleportat cu succes.");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 256, ""#GAlbastru"[Suceava-RPG]: {ffffff}Admin {059e42}[%s]{ffffff} a folosit comanda {f70f0f}[/gotols]", sendername);
SendAdminMessage(COLOR_LIGHTRED,string);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
SetPlayerVirtualWorld(playerid, 0);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, ""#GAlbastru"[Suceava-RPG]: {ffffff}Ne pare rau, dar nu ai acces la aceasta comanda.");
}
}
return 1;
}
CMD:gotopos(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new targetid;
if(sscanf(params, "u", targetid)) SendClientMessage(playerid,-1,""chat" /gotopos [playerid]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""chat" Player is not online");
new Float:x,Float:y,Float:z,inter;
GetPlayerPos(targetid,Float:x,Float:y,Float:z);
inter = GetPlayerInterior(targetid);
SetPlayerPosEx(playerid,Float:x,Float:y,Float:z,inter,0);
}
else {
SendClientMessage(playerid,-1,""chat""COL_GREY" You cannot use this command");
}
return 1;
}
CMD:goto(playerid, params[], help)//LVL1 { if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid,-1,""COLOR_RED"<<Error>>"COLOR_WHITE" You Aren't An"COLOR_RED" Admin!"); new pplayerid,Float:Pos[3]; if(sscanf(params, "u", pplayerid)) return SendClientMessage(playerid,-1,""COLOR_RED"<<Usage>>"COLOR_WHITE" /goto [Player ID/Player Name]"); if(pplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,""COLOR_RED"<<Error>>"COLOR_WHITE" Wrong Player"COLOR_RED" ID!"); GetPlayerPos(pplayerid,Pos[0],Pos[1],Pos[2]); SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]); SetPlayerInterior(playerid,GetPlayerInterior(pplay erid)); return 1; } CMD:gotopos(playerid, params[], help)//LVL1 { if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid,-1,""COLOR_RED"<<Error>>"COLOR_WHITE" You Aren't An"COLOR_RED" Admin!"); new Float:Pos[3],int; if(sscanf(params, "fffi",Pos[0],Pos[1],Pos[2],int)) return SendClientMessage(playerid,-1,""COLOR_RED"<<Usage>>"COLOR_WHITE" /gotopos [X] [Y] [Z] [Interior ID]"); SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]); SetPlayerInterior(playerid, int); return 1; } |
D:\samp03\gamemodes\GameFront.pwn(49246) : error 001: expected token: "-string end-", but found "-identifier-"
D:\samp03\gamemodes\GameFront.pwn(49246) : error 017: undefined symbol "chat"
D:\samp03\gamemodes\GameFront.pwn(49246) : warning 215: expression has no effect
D:\samp03\gamemodes\GameFront.pwn(49246) : error 001: expected token: ";", but found ")"
D:\samp03\gamemodes\GameFront.pwn(49246) : fatal error 107: too many error messages on one line
if(sscanf(params, "u", targetid)) SendClientMessage(playerid,-1,""chat" /gotopos [playerid]");
""chat" /gotopos [playerid]");
"/gotopos [playerid]");
SendClientMessage(playerid,-1,""chat""COL_GREY" You cannot use this command");
SendClientMessage(playerid, COL_GREY,"You cannot use this command");//-1 is a random color and after that you use COL_GREY be sure this is defined or you must use code like 0xFFFFFFAA (White)
CMD:gotopos(playerid, params[])
{
new Float:Pos[3], int;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on Admin Duty.");
if(sscanf(params, "fffi", Pos[0], Pos[1], Pos[2], int)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /gotopos [x] [y] [z] [int]");
SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
SetPlayerInterior(playerid, int);
return 1;
}
WHY Chat? you are checking the ssanf params there so
pawn Код:
pawn Код:
also pawn Код:
pawn Код:
|
WHY Chat? you are checking the ssanf params there so
pawn Код:
pawn Код:
also pawn Код:
pawn Код:
|