plugins sscanf.dll
plugins sscanf.so
#include <YSI\y_commands>
#include <sscanf2>
public OnGameModeInit()
{
return 1;
}
YCMD:teste(playerid, params[], help)
{
return 1;
}
YCMD:teste(playerid, o, help)
{
return 1;
}
YCMD:testando(playerid, params[], help)
{
if (help) return SendClientMessage(playerid, -1, "comando lindo.");
SendClientMessage(playerid, -1, "funciona");
return 1;
}
YCMD:testando2(playerid, params[], help)
{
if (help) return SendClientMessage(playerid, -1, "comando feo.");
SendClientMessage(playerid, -1, "funciona2");
return 1;
}
YCMD:ayudacomando(playerid, params[], help)
{
if (isnull(params)) return SendClientMessage(playerid, -1, "uso: /ayudacomando [comando]");
Command_ReProcess(playerid, params, true);
// leerб el parametro 'help' comando para poner
return 1;
}
YCMD:hola(playerid, params[], help)
{
SendClientMessage(playerid, -1, "PT el comando funciona!");
return 1;
}
warning 203: symbol is never used "params" warning 203: symbol is never used "help"
YCMD:hola(playerid, params[], help)
{
#pragma unused params, help
SendClientMessage(playerid, -1, "PT el comando funciona!");
return 1;
}
YCMD:adm(playerid, params[], help)
{
new string[ 128 ];
new pname[ MAX_PLAYER_NAME ];
if( !IsPlayerAdmin(playerid) ) return SendClientMessage(playerid, -1, "Este comando no lo puedes usar");
if( help ) return SendClientMessage(playerid, -1, "Este es un comando de admin RCON");
if( isnull( params ) ) return SendClientMessage(playerid, -1, "Error: /adm [texto]");
GetPlayerName( playerid, pname, sizeof( pname ) );
format( string, sizeof( string ),"(RCON) %s: %s", pname, params);
SendClientMessageToAll(-1, string);
return 1;
}
new string[ 128 ];
new pname[ MAX_PLAYER_NAME ];
new string[ 128 ], pname[ MAX_PLAYER_NAME ];
if( help ) return SendClientMessage(playerid, -1, "Este es un comando de admin RCON");
if( isnull( params ) ) return SendClientMessage(playerid, -1, "Error: /adm [texto]");
format( string, sizeof( string ),"(RCON) %s: %s", pname, params);
(RCON) PT: testando
%b para ingresar un numero binario %c para ingresar un unico caracter %d para ingresar un numero entero %f para ingresar un numero con coma %i para ingresar un numero entero %s para ingresar una cadena, como por ejemplo un texto %x para ingresar un numero hexadecimal %% para ingresar literalmente el signo '%'
YCMD:vida(playerid, params[], help)
{
new ID;
if( help ) return SendClientMessage(playerid, -1, "Este comando dara vida a 1 jugador!");
if( sscanf( params, "u", ID ) ) return SendClientMessage(playerid, -1, "Uso: /vida [PlayerName / ID]");
if( PlayerID == INVALID_PLAYER_ID ) return SendClientMessage(playerid, -1, "[ERROR] Este jugador esta OFFLINE");
SetPlayerHealth(ID, 100);
return 1;
}
if( help ) return SendClientMessage(playerid, -1, "Este comando dara vida a 1 jugador!");
if( sscanf( params, "d", ID ) ) return SendClientMessage(playerid, -1, "Error: /vida [ID]");
if( ID == INVALID_PLAYER_ID ) return SendClientMessage(playerid, -1, "[ERROR] Este jugador esta OFFLINE");
if(sscanf( params, "Especificaciones", nuestras variables ) ) // Si el jugador entrу en los parбmetros incorrectos
{
// mensaje para advertir al jugador
}
a - si un personaje. f - si se trata de un nъmero de punto flotante (float). i / d - si un nъmero entero. s - si se trata de una cadena. x / h - Introduce un nъmero en notaciуn hexadecimal. z - si un texto opcional px - si es un delimitador adicional donde X en otro jugador. '' - Para localizar una cadena (de texto). u - parte de un nombre o un ID
YCMD:comandos(playerid, params[], help)
{
if ( help ) return SendClientMessage(playerid, -1, "Lista de todos los comandos.");
new count = Command_GetPlayerCommandCount( playerid );
for ( new i = 0; i != count; ++i) SendClientMessage( playerid, -1, Command_GetNext ( i, playerid ) );
return 1;
}
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if( !success ) return false;
return true;
}
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if( !success )
{
format( cmdtext, 128, "ERROR: El comando %s no existe mira /comandos", cmdtext );
SendClientMessage( playerid, -1, cmdtext );
}
return true;
}
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <YSI\y_commands>
#include <sscanf2>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
Command_AddAltNamed("information", "info");
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
YCMD:teste(playerid, params[], help)
{
return 1;
}
YCMD:teste(playerid, o, help)
{
return 1;
}
YCMD:testando(playerid, params[], help)
{
if (help) return SendClientMessage(playerid, -1, "comando lindo.");
SendClientMessage(playerid, -1, "funciona");
return 1;
}
YCMD:testando2(playerid, params[], help)
{
if (help) return SendClientMessage(playerid, -1, "comando feo.");
SendClientMessage(playerid, -1, "funciona2");
return 1;
}
YCMD:ayudacomando(playerid, params[], help)
{
if (isnull(params)) return SendClientMessage(playerid, -1, "uso: /ayudacomando [comando]");
Command_ReProcess(playerid, params, true);
// leerб el parametro 'help' comando para poner
return 1;
}
YCMD:hola(playerid, params[], help)
{
#pragma unused params, help
SendClientMessage(playerid, -1, "PT el comando funciona!");
return 1;
}
YCMD:adm(playerid, params[], help)
{
new string[ 128 ];
new pname[ MAX_PLAYER_NAME ];
if( !IsPlayerAdmin(playerid) ) return SendClientMessage(playerid, -1, "Este comando no lo puedes usar");
if( help ) return SendClientMessage(playerid, -1, "Este es un comando de admin RCON");
if( isnull( params ) ) return SendClientMessage(playerid, -1, "Error: /adm [texto]");
GetPlayerName( playerid, pname, sizeof( pname ) );
format( string, sizeof( string ),"(RCON) %s: %s", pname, params);
SendClientMessageToAll(-1, string);
return 1;
}
YCMD:vida(playerid, params[], help)
{
new ID;
if( help ) return SendClientMessage(playerid, -1, "Este comando dara vida a 1 jugador!");
if( sscanf( params, "u", ID ) ) return SendClientMessage(playerid, -1, "Uso: /vida [PlayerName / ID]");
if( PlayerID == INVALID_PLAYER_ID ) return SendClientMessage(playerid, -1, "[ERROR] Este jugador esta OFFLINE");
SetPlayerHealth(ID, 100);
return 1;
}
YCMD:comandos(playerid, params[], help)
{
if ( help ) return SendClientMessage(playerid, -1, "Lista de todos los comandos.");
new count = Command_GetPlayerCommandCount( playerid );
for ( new i = 0; i != count; ++i) SendClientMessage( playerid, -1, Command_GetNext ( i, playerid ) );
return 1;
}
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if( !success )
{
format( cmdtext, 128, "ERROR: El comando %s no existe mira /comandos", cmdtext );
SendClientMessage( playerid, -1, cmdtext );
}
return true;
}
Hacia falta uno de estos tutorial, ya que no hay ningъn "creo" en esta secciуn, se agradece mucho "PT" por el tutorial muy bien explicado, mucha paciencia, cuando pueda te doy rep!
Saludos. |
Buen tutorial amigo, yo tambien estoy haciendo un tuto.. manana lo leo bien
|
String
|
new array[2];
array[0] = 'a'; //El 1er caracter es la 'a'
array[1] = 'b'; //El 2do caracter es la 'b'