13.03.2011, 21:32
Hola, de nuevo :P! Con en /spec tengo el problema que mientras "specto" a alguien y otra persona entra/sale de un vehнculo lo empieza a espectar a ese automбticamente -.-! Codigo(es largo):
Y con el /endspec no se sale el dialogo de abajo con la informaciуn (el que dice la plata, velocidad y todo eso), codigo:
Ahh.. me acorde que con el comando /speedo tengo el mismo problema que no se borra al velocidad, osea cuando pones el comando dice que se apago y se deja de actualizar la velocidad, despues si salgo y entro del auto hay no aparece, pero no desaparece apenas pones el comando, codigo:
Bueno, creo que puse un montуn de cosas :S! Perdуn, y gracias por todo, si es difнcil de arreglar, no se hagan problema, me busco algъn FS de spec y listo :P
pawn Код:
if (strcmp(cmd, "/spec", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USO: /spec [playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
new Float:Health, Float:Armour;
new World = GetPlayerVirtualWorld(playerid);
new PlInterior = GetPlayerInterior(playerid);
new weaponid, ammo;
GetPlayerHealth(playerid, Health);
GetPlayerArmour(playerid, Armour);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(Spectate[playerid] == 255)
{
GetPlayerPos(playerid, TeleportDest[playerid][0],TeleportDest[playerid][1],TeleportDest[playerid][2]);
if(PlayerInfo[playerid][pAdmin] >= 6)
{
if(PlayerInfo[playerid][pAdminDuty] == 1)
{
for (new i=0; i<13; i++)
{
GetPlayerWeaponData(playerid, i, weaponid, ammo);
OtherWeapons[playerid][i] = weaponid;
OtherAmmo[playerid][i] = ammo;
}
SpHealth[playerid] = Health;
SpArmour[playerid] = Armour;
}
else
{
SaveGuns(playerid);
PlayerInfo[playerid][pHealth] = Health;
PlayerInfo[playerid][pArmour] = Armour;
}
}
else
{
SaveGuns(playerid);
PlayerInfo[playerid][pHealth] = Health;
PlayerInfo[playerid][pArmour] = Armour;
}
}
Interior[playerid] = PlInterior;
VirWorld[playerid] = World;
TogglePlayerSpectating(playerid, 1);
if(IsPlayerInAnyVehicle(giveplayerid)) { PlayerSpectateVehicle(playerid, GetPlayerVehicleID(giveplayerid)); }
else { PlayerSpectatePlayer(playerid, giveplayerid); }
Spectate[playerid] = giveplayerid;
SafeSetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "[ADMIN]: %s Is Now Spectating %s (%d).", sendername, giveplayer, giveplayerid);
SendAdminMessage(COLOR_LIGHTRED,string);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You are now spectating this player. To Unspec him spec another id or type /endspec <playerid>");
TextDrawHideForPlayer(playerid, Textdraw44);
TextDrawHideForPlayer(playerid, Textdraw45);
TextDrawHideForPlayer(playerid, Textdraw55);
TextDrawHideForPlayer(playerid, Textdraw51[playerid]);
TextDrawShowForPlayer(playerid, Textdraw54[playerid]);
if(PlayerInfo[playerid][pWatch] == 1)
{
TextDrawHideForPlayer(playerid, Textdraw56);
TextDrawHideForPlayer(playerid, Textdraw57);
TextDrawHideForPlayer(playerid, Textdraw58);
}
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 is speccing %s's",d,m,y,h,mi,s,sendername,giveplayer);
AdminLog(string);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " No Such Player");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not an admin");
}
}
return 1;
}
pawn Код:
if (strcmp(cmd, "/endspec", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USO: /endspec [playerid/PartOfName]");
return 1;
}
//giveplayerid = strval(tmp);
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
TogglePlayerSpectating(playerid, 0);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "[ADMIN]: %s Is No longer Spectating %s (%d).", sendername, giveplayer, giveplayerid);
SendAdminMessage(COLOR_LIGHTRED,string);
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 is speccing %s's",d,m,y,h,mi,s,sendername,giveplayer);
AdminLog(string);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " No Such Player");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not an admin");
}
}
return 1;
}
pawn Код:
if(strcmp(cmd, "/speedo", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pSpeedo] == 1)
{
PlayerInfo[playerid][pSpeedo] = 2;
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~g~on", 5000, 5);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
}
else if(PlayerInfo[playerid][pSpeedo] == 2)
{
PlayerInfo[playerid][pSpeedo] = 1;
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~r~off", 5000, 5);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "you dont have a speedometer");
}
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] -> /speedo",d,m,y,h,mi,s,sendername);
CommandLog(string);
}
return 1;
}