if(strcmp(cmd, "/goto", true) == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(sendername), "level");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_DBLUE, "Uso correto: /goto [id do player]");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
giveplayerid = strval(tmp);
if(logged[playerid] == 1)
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
if(IsPlayerConnected(giveplayerid))
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Vocк se teleportou para %s(%i).", giveplayer, giveplayerid);
SendClientMessage(playerid, COLOR_BLUE, string);
GetPlayerPos(giveplayerid, plocx, plocy, plocz);
new intid = GetPlayerInterior(giveplayerid);
SetPlayerInterior(playerid,intid);
new PlayerName[30];
GetPlayerName(playerid, PlayerName, 30);
printf("[Command] %s usou /goto para se teleportar para %s.", PlayerName, giveplayer);
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
}
else
{
SetPlayerPos(playerid,plocx,plocy+2, plocz);
}
}
else
{
format(string, sizeof(string), "%d nгo й um player ativo!", giveplayerid);
SendClientMessage(playerid, COLOR_RED, string);
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Vocк nгo permissгo para usar este comando!");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Vocк tem que estar logado para usar este comando!");
}
return 1;
}
if(strcmp(cmd, "/goto", true) == 0)
{
if(Admin[playerid] < 1) return SendClientMessage(playerid, VERDE_AZUL, "Erro: {FFA500} Vocк nгo estб autorizado a usar este comando.");
if(AFK[playerid] == 1) return SendClientMessage(playerid, VERDE_AZUL, "Erro: {FFA500} Vocк estб AFK.");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, -1, "Uso: /goto [ID]");
new id, Float:P[3], str[128], n[24], n2[24];
id = ReturnUser(tmp);
if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "ID INVALIDO");
GetPlayerName(id, n, sizeof(n));
GetPlayerName(playerid, n2, 24);
GetPlayerPos(id, P[0], P[1], P[2]);
SetPlayerPos(playerid, P[0]+1, P[1], P[2]+0.5);
SetPlayerInterior(playerid, GetPlayerInterior(id));
format(str, sizeof(str), "Vocк foi atй o jogador {FF00FF}%s{FFFFFF} .", n);
SendClientMessage(playerid, -1, str);
format(str, sizeof(str), "O admin {FF00FF} %s{FFFFFF} veio atй vocк.", n2);
SendClientMessage(id, -1, str);
return 1;
}
if(strcmp(cmd, "/goto", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_DBLUE, "Uso correto: /goto [id do player]");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
giveplayerid = strval(tmp);
if(logged[playerid] == 1)
{
if(IsPlayerConnected(giveplayerid))
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
new PlayerName[30];
GetPlayerName(playerid, PlayerName, 30);
format(string, sizeof(string), "Vocк se teleportou para %s(%i).", giveplayer, giveplayerid);
SendClientMessage(playerid, COLOR_BLUE, string);
GetPlayerPos(giveplayerid, plocx, plocy, plocz);
new intid = GetPlayerInterior(giveplayerid);
SetPlayerInterior(playerid,intid);
printf("[Command] %s usou /goto para se teleportar para %s.", PlayerName, giveplayer);
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
}
else
{
SetPlayerPos(playerid,plocx,plocy+2, plocz);
}
}
else
{
format(string, sizeof(string), "%d nгo й um player ativo!", giveplayerid);
SendClientMessage(playerid, COLOR_RED, string);
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Vocк tem que estar logado para usar este comando!");
}
return 1;
}
Isto deve resolver o seu problema :
Adaptei pra vocк : pawn Код:
Espero ter ajudado . |
C:\Users\Jefferson Gomes\Desktop\SAMP 0.3a Server [De]\gamemodes\De.pwn(4469) : error 017: undefined symbol "logged"
C:\Users\Jefferson Gomes\Desktop\SAMP 0.3a Server [De]\gamemodes\De.pwn(4469) : warning 215: expression has no effect
C:\Users\Jefferson Gomes\Desktop\SAMP 0.3a Server [De]\gamemodes\De.pwn(4469) : error 001: expected token: ";", but found "]"
C:\Users\Jefferson Gomes\Desktop\SAMP 0.3a Server [De]\gamemodes\De.pwn(4469) : error 029: invalid expression, assumed zero
C:\Users\Jefferson Gomes\Desktop\SAMP 0.3a Server [De]\gamemodes\De.pwn(4469) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
if(logged[playerid] == 1)
C:\Users\Jefferson Gomes\Desktop\SAMP 0.3a Server [De]\gamemodes\De.pwn(4475) : error 017: undefined symbol "string"
C:\Users\Jefferson Gomes\Desktop\SAMP 0.3a Server [De]\gamemodes\De.pwn(4475) : error 017: undefined symbol "string"
C:\Users\Jefferson Gomes\Desktop\SAMP 0.3a Server [De]\gamemodes\De.pwn(4475) : error 029: invalid expression, assumed zero
C:\Users\Jefferson Gomes\Desktop\SAMP 0.3a Server [De]\gamemodes\De.pwn(4475) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
format(string, sizeof(string), "Vocк se teleportou para %s(%i).", giveplayer, giveplayerid);
C:\Users\Jefferson Gomes\Desktop\SAMP 0.3a Server [De]\gamemodes\De.pwn(4475) : error 017: undefined symbol "string"
if(strcmp(cmd, "/goto", true) == 0)
{
#if !defined COLOR_DBLUE
#define COLOR_DBLUE 0x7777DDFF
#endif
#if !defined COLOR_BLUE
#define COLOR_BLUE 0x33CCFFAA
#endif
#if !defined COLOR_RED
#define COLOR_RED 0xAA3333AA
#endif
new string[60];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_DBLUE, "Uso correto: /goto [id do player]");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
giveplayerid = strval(tmp);
if(IsPlayerConnected(giveplayerid))
{
new PlayerName[30], GivePlayerName[30];
GetPlayerName(playerid, PlayerName, 30);
GetPlayerName(giveplayerid, GivePlayerName, 30);
format(string, sizeof(string), "Vocк se teleportou para %s(%i).", GivePlayerName, giveplayerid);
SendClientMessage(playerid, COLOR_BLUE, string);
GetPlayerPos(giveplayerid, plocx, plocy, plocz);
new intid = GetPlayerInterior(giveplayerid);
SetPlayerInterior(playerid,intid);
printf("[Command] %s usou /goto para se teleportar para %s.", PlayerName, GivePlayerName);
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
}
else
{
SetPlayerPos(playerid,plocx,plocy+2, plocz);
}
}
else
{
format(string, sizeof(string), "%d nгo й um player ativo!", giveplayerid);
SendClientMessage(playerid, COLOR_RED, string);
}
return 1;
}