19.12.2010, 23:29
(
Последний раз редактировалось Nicolassanch; 20.12.2010 в 09:51.
)
hola a todos los de Forum SAMP, necesito ayuda, los comandos que puse en OnPlayerCommandText no anda ninguno, cuando los ejecuto no me aparece nada, por ejemplo pongo /ayuda y no sale nada es como si nunca puse /ayuda, tambien con los teleports pongo /lv y nada
les dejo la lista de OnPlayerCommandText
ayuda por favor
era un FS mal puesto, gracias a todos igual
les dejo la lista de OnPlayerCommandText
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
new playermoney;
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new cmd[256];
new giveplayerid, moneys, idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/ayuda", true) == 0)
{
SendClientMessage(playerid,VERDE_,"============================================================================");
SendClientMessage(playerid,AZUL_CLARO,"Usa /reglas para ver las reglas del servidor.");
SendClientMessage(playerid,AZUL_CLARO,"Usa /teles para ver la lista de teleports.");
SendClientMessage(playerid,AZUL_CLARO,"Usa /comandos para ver la lista de comandos.");
SendClientMessage(playerid,AZUL_CLARO,"Usa /cmdscuenta para ver los comandos de usuarios.");
return 1;
}
if(strcmp(cmd, "/cmdscuenta", true) == 0)
{
SendClientMessage(playerid,VERDE_,"============================================================================");
SendClientMessage(playerid,AGUAMARINA,"Usa /stats para ver tu estado.");
return 1;
}
if(strcmp(cmd, "/teles", true) == 0)
{
SendClientMessage(playerid,VERDE_,"============================================================================");
SendClientMessage(playerid,LIMON,"Drifts: /drift1 - /drift2 - /drift3 - /drift4 - /drift5 - /drift6");
SendClientMessage(playerid,LIMON,"Stunts: /zonastunt1");
SendClientMessage(playerid,LIMON,"saltos: /supersalto1");
SendClientMessage(playerid,LIMON,"Ciudades: /sf - /lv - /ls");
SendClientMessage(playerid,LIMON,"Aeropuertos: /aerosf - /aerolv - /aerols");
SendClientMessage(playerid,LIMON,"parkour: /parkour1");
SendClientMessage(playerid,LIMON,"Otros: /ovni - /area51");
return 1;
}
if(strcmp(cmd, "/reglas", true) == 0)
{
SendClientMessage(playerid,VERDE_,"============================================================================");
SendClientMessage(playerid,AMARILLO,"-No se puede usar Cheats/Hacks en este server.");
SendClientMessage(playerid,AMARILLO,"-No hacer SPAM de otros servidores.");
SendClientMessage(playerid,AMARILLO,"-No faltarle el respeto a los Players y a los Admins.");
SendClientMessage(playerid,AMARILLO,"-No atacar en las zonas de Stunt.");
SendClientMessage(playerid,AMARILLO,"-Si ayudar a los otros Players.");
SendClientMessage(playerid,AMARILLO,"-No hacer DriveBy (atacar desde un carro a un player de pie).");
SendClientMessage(playerid,AMARILLO,"-No hacer flood.");
SendClientMessage(playerid,AMARILLO,"-No pidas ser admin.");
return 1;
}
if(strcmp(cmd, "/reglas", true) == 0)
{
SendClientMessage(playerid,VERDE_,"============================================================================");
SendClientMessage(playerid,AMARILLO,"-No se puede usar Cheats/Hacks en este server.");
SendClientMessage(playerid,AMARILLO,"-No hacer SPAM de otros servidores.");
SendClientMessage(playerid,AMARILLO,"-No faltarle el respeto a los Players y a los Admins.");
SendClientMessage(playerid,AMARILLO,"-No atacar en las zonas de Stunt.");
SendClientMessage(playerid,AMARILLO,"-Si ayudar a los otros Players.");
SendClientMessage(playerid,AMARILLO,"-No hacer DriveBy (atacar desde un carro a un player de pie).");
SendClientMessage(playerid,AMARILLO,"-No hacer flood.");
SendClientMessage(playerid,AMARILLO,"-No pidas ser admin.");
return 1;
}
if(strcmp(cmd, "/comandos", true) == 0)
{
SendClientMessage(playerid,VERDE_,"============================================================================");
SendClientMessage(playerid,ROJO_CLARO,"Usa /afk si quieres estar ausente.");
SendClientMessage(playerid,AZUL_CLARO,"Usa /acciones para ver la lista de animaciones.");
SendClientMessage(playerid,ROJO_CLARO,"Usa /estilos para ver los estilos de lucha disponibles.");
SendClientMessage(playerid,ROJO_CLARO,"Usa /colores para cambiar tu color de nick.");
SendClientMessage(playerid,AZUL_CLARO,"usa /regenera para regenerar vida y comprar chaleco.");
SendClientMessage(playerid,ROJO_CLARO,"Usa /pm [ID] [mensaje] para enviar mensajes privados (los admins pueden verlos).");
SendClientMessage(playerid,AZUL_CLARO,"Usa /vm para menu de Autos.");
SendClientMessage(playerid,ROJO_CLARO,"Usa /wm para menu de Armas.");
SendClientMessage(playerid,AZUL_CLARO,"Usa /desbug para desbugearte.");
return 1;
}
if(strcmp(cmd, "/regenera", true) == 0) {
SendClientMessage(playerid,AGUAMARINA ,"-------------Te regeneraste por $1050 y de promo un chaleco.-------------");
SetPlayerHealth(playerid, 100.0);
SetPlayerArmour(playerid, 100.0);
GivePlayerMoney(playerid, -1050);
return 1;
}
if(strcmp(cmd, "/lv", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid),2032.9454,1545.1099,10.8203);
}
else
{
SetPlayerPos(playerid,2032.9454,1545.1099,10.8203);
}
return 1;
}
if(strcmp(cmd, "/aerolv", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid),1710.1779,1606.3663,10.0156);
}
else
{
SetPlayerPos(playerid,1710.1779,1606.3663,10.0156);
}
return 1;
}
if(strcmp(cmd, "/sf", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid),-1917.1392,300.5802,41.0469);
}
else
{
SetPlayerPos(playerid,-1917.1392,300.5802,41.0469);
}
return 1;
}
if(strcmp(cmd, "/aerosf", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid),-1653.3431,-176.8579,14.1484);
}
else
{
SetPlayerPos(playerid,-1653.3431,-176.8579,14.1484);
}
return 1;
}
if(strcmp(cmd, "/ls", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid),2491.2500,-1664.1053,13.3438);
}
else
{
SetPlayerPos(playerid,2491.2500,-1664.1053,13.3438);
}
return 1;
}
if(strcmp(cmd, "/aerols", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid),1974.5787,-2261.6853,13.5469);
}
else
{
SetPlayerPos(playerid,1974.5787,-2261.6853,13.5469);
}
return 1;
}
if(strcmp(cmd, "/area51", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid),214.0794,1914.3394,17.6406);
}
else
{
SetPlayerPos(playerid,214.0794,1914.3394,17.6406);
}
return 1;
}
if (strcmp("/parkour1", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid,941.1949,-2337.1860,11.2498);
GameTextForPlayer(playerid, "Bienvenido a Parkour1",5000,5);
return 1;
}
if(strcmp(cmd, "/zonastunt1", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid),1272.6719,3130.1741,27.1507);
}
else
{
SetPlayerPos(playerid,1272.6719,3130.1741,27.1507);
}
return 1;
}
if(strcmp(cmd, "/supersalto1", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid),1311.8074,3954.6660,253.1157);
}
else
{
SetPlayerPos(playerid,1311.8074,3954.6660,253.1157);
}
return 1;
}
if(strcmp(cmd, "/drift1", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid),2263.9824,1398.8612,42.4124);
}
else
{
SetPlayerPos(playerid,2263.9824,1398.8612,42.4124);
}
SendClientMessage(playerid,VERDE_CLARO,"Bienvenido al Drift1");
return 1;
}
if(strcmp(cmd, "/drift2", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid),-2410.2888,-600.1959,132.6484);
}
else
{
SetPlayerPos(playerid,-2410.2888,-600.1959,132.6484);
}
SendClientMessage(playerid,VERDE_CLARO,"Bienvenido al Drift2");
return 1;
}
if(strcmp(cmd, "/drift3", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid),1266.7728,-2035.0243,59.2149);
}
else
{
SetPlayerPos(playerid,1266.7728,-2035.0243,59.2149);
}
SendClientMessage(playerid,VERDE_CLARO,"Bienvenido al Drift3");
return 1;
}
if(strcmp(cmd, "/drift4", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid),2111.6428,2372.5369,49.1848);
}
else
{
SetPlayerPos(playerid,2111.6428,2372.5369,49.1848);
}
SendClientMessage(playerid,VERDE_CLARO,"Bienvenido al Drift4");
return 1;
}
if(strcmp(cmd, "/drift5", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid),2247.8843,1967.4460,31.4996);
}
else
{
SetPlayerPos(playerid,2247.8843,1967.4460,31.4996);
}
SendClientMessage(playerid,VERDE_CLARO,"Bienvenido al Drift5");
return 1;
}
if(strcmp(cmd, "/drift6", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid),-323.6779,1531.0891,75.0186);
}
else
{
SetPlayerPos(playerid,-323.6779,1531.0891,75.0186);
}
SendClientMessage(playerid,VERDE_CLARO,"Bienvenido al Drift6");
return 1;
}
if (strcmp("/afk", cmdtext, true) == 0)
{
if(Info[playerid][AFK] == 0)
{
GetPlayerArmour(playerid,Chaleco[playerid]);
GetPlayerHealth(playerid,VidaP[playerid]);
//new string[256];
// new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nombre, sizeof(Nombre));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s esta ahora en modo AFK!.", sendername);
SendClientMessageToAll(COLOR_VERDE, string);
SendClientMessage(playerid, BLANCO,"Usa /salirafk para salir del modo AFK.");
format(string, sizeof(string), "[AFK]%s", sendername);
SetPlayerName(playerid,string);
TogglePlayerControllable(playerid, 0);
SetPlayerHealth(playerid, 999999999);
SetPlayerArmour(playerid, 999999999);
Info[playerid][AFK] = 1;
Info[playerid][SHH] = 1;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ROJO, "Ya estas en modo AFK!");
return 1;
}
}
if (strcmp("/salirafk", cmdtext, true) == 0)
{
if(Info[playerid][AFK] == 1)
{
TogglePlayerControllable(playerid,1);
SetPlayerArmour(playerid,Chaleco[playerid]);
SetPlayerHealth(playerid,VidaP[playerid]);
Info[playerid][AFK] = 0;
Info[playerid][SHH] = 0;
//new string[256];
// new sendername[MAX_PLAYER_NAME];
format(string, sizeof(string), "%s",Nombre);
SetPlayerName(playerid,string);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s ha salido del modo AFK.", sendername);
SendClientMessageToAll(NARANJA, string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ROJO, "No estas en modo AFK!");
return 1;
}
}
if (strcmp(cmdtext, "/estilos", true) == 0)
{
SendClientMessage(playerid,VERDE_,"============================================================================");
SendClientMessage(playerid, NARANJA, "Usa /boxeo para elejir para pelear con estilo de Boxeo");
SendClientMessage(playerid, NARANJA, "Usa /kungfu para elejir para pelear con estilo KungFu");
SendClientMessage(playerid, NARANJA, "Usa /patadas para elejir el estilo de peleas con Patadas");
SendClientMessage(playerid, NARANJA, "Usa /codos para elejir el estilo de pelea con Codos");
SendClientMessage(playerid, NARANJA, "Usa /normal para elejir el estulo normal del juego");
return 1;
}
if (strcmp(cmdtext, "/boxeo", true) == 0)
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_BOXING);
SendClientMessage(playerid, VERDE_, "Has cambiado tu estilo de lucha a Boxeo");
return 1;
}
if (strcmp(cmdtext, "/kungfu", true) == 0)
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_KUNGFU);
SendClientMessage(playerid, VERDE_, "Has cambiado tu estilo de lucha a Kung Fu");
return 1;
}
if (strcmp(cmdtext, "/patadas", true) == 0)
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_GRABKICK);
SendClientMessage(playerid, VERDE_, "Has cambiado tu estilo de lucha a Patadas");
return 1;
}
if (strcmp(cmdtext, "/codos", true) == 0)
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_ELBOW);
SendClientMessage(playerid, VERDE_, "Has cambiado tu estilo de lucha a Codos");
return 1;
}
if (strcmp(cmdtext, "/normal", true) == 0)
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_NORMAL);
SendClientMessage(playerid, VERDE_, "Has cambiado tu estilo de lucha a Normal");
return 1;
}
if (strcmp("/dardinero", cmdtext, true) == 0)
{
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USA: /dardinero [JugadorID] [Cantidad]");
return 1;
}
giveplayerid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USA: /dardinero [JugadorID] [Cantidad]");
return 1;
}
moneys = strval(tmp);
if (IsPlayerConnected(giveplayerid))
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = GetPlayerMoney(playerid);
if (moneys > 0 && playermoney >= moneys) {
GivePlayerMoney(playerid, (0 - moneys));
GivePlayerMoney(giveplayerid, moneys);
format(string, sizeof(string), "Enviaste a %s[ID: %d], $%d.", giveplayer,giveplayerid, moneys);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "Has recibido $%d del jugador %s[ID: %d].", moneys, sendername, playerid);
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
printf("%s(playerid:%d) has transfered %d to %s(playerid:%d)",sendername, playerid, moneys, giveplayer, giveplayerid);
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "No tienes tanto dinero!");
}
}
else
{
format(string, sizeof(string), "%d no esta conectado.", giveplayerid);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
return 1;
}
SendClientMessage(playerid,COLOR_ROJO,"Comando desconocido. Usa /comandos para ver los comandos"); return 1;
}
era un FS mal puesto, gracias a todos igual