if(strcmp( cmd, "/vc", true ) == 0 )
{
new Float:X, Float:Y, Float:Z;
new tmp[256];
new created_vehicle_id;
tmp = strtok( cmdtext, idx );
GetPlayerPos( playerid, X, Y, Z );
created_vehicle_id = CreateVehicle( strval(tmp), X+2, Y+2, Z, 0, 0, 0, -1 );
new msg[256];
format(msg,256,"Created vehicle: %d",created_vehicle_id);
SendClientMessage(playerid,0xAAAAAAAA,msg);
return 1;
}
if(strcmp( cmd, "/vc", true ) == 0 )
{
if(IsPlayerAdmin(playerid))
{
new Float:X, Float:Y, Float:Z;
new tmp[256];
new created_vehicle_id;
tmp = strtok( cmdtext, idx );
GetPlayerPos( playerid, X, Y, Z );
created_vehicle_id = CreateVehicle( strval(tmp), X+2, Y+2, Z, 0, 0, 0, -1 );
new msg[256];
format(msg,256,"Created vehicle: %d",created_vehicle_id);
SendClientMessage(playerid,0xAAAAAAAA,msg);
}
return 1;
}
if(strcmp( cmd, "/weap", true ) == 0 )
{
new tmp[256];
tmp = strtok( cmdtext, idx );
GivePlayerWeapon(playerid, strval(tmp), 9999);
return 1;
}
if(strcmp( cmd, "/weap", true ) == 0 )
{
if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, BLANCO, "No eres RCON admin.");
{
new tmp[256];
tmp = strtok( cmdtext, idx );
GivePlayerWeapon(playerid, strval(tmp), 9999);
}
return 1;
}
Gracias, ahora tengo una duda.
Quiero hacer un comando para dar armas. Osea que el admin rcon le de un arma al usuario, como seria posible? PHP код:
|
zcmd(weap, playerid, params[]) { if(IsPlayerAdmin(playerid)) { if(!sscanf(params, "uii", params[0], params[1], params[2])) { GivePlayerWeapon(params[0], params[1], params[2]); } else SendClientMessage(playerid, -1, "Utiliza: /weap <id> <arma> <balas>"); } else SendClientMessage(playerid, -1, "No eres administrador RCON"); return 1; }
Gracias, ahora tengo una duda.
Quiero hacer un comando para dar armas. Osea que el admin rcon le de un arma al usuario, como seria posible? PHP код:
|
if(strcmp( cmd, "/weap", true ) == 0 )
{
if(IsPlayerAdmin(playerid)) // <-- Si playerid es admin rcon se ejecutara todo lo que esta dentro de la llave{}
{
new tmp[256];
tmp = strtok( cmdtext, idx );
GivePlayerWeapon(playerid, strval(tmp), 9999);
}
return 1;
}
CMD:setweapon(playerid, params[])
{
if(sscanf(params,"uii",params[0], params[1], params[2])) return SendClientMessage(playerid, -1, "Server: Usa /setweapon (playerid) (weaponid) (municion)");
if(IsPlayerAdmin(playerid))
{
new WEAPONAME[32], str[128], string[128], Nombre[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetWeaponName(params[1],WEAPONAME,sizeof(WEAPONAME));
GetPlayerName(playerid,Nombre,MAX_PLAYER_NAME);
GetPlayerName(params[0],PlayerName,MAX_PLAYER_NAME);
GivePlayerWeapon(params[0],params[1], params[2]);
format(string,sizeof( string ), "%s Administrador te dio una %s con %d de municion", Nombre, WEAPONAME, params[2]);
format(str,sizeof( str), "Le distes una %s con %d de municion a el usuario %s", WEAPONAME, params[2], PlayerName);
SendClientMessage(playerid, -1,str);
SendClientMessage(params[0],-1,string);
}
return 1;
}
PHP код:
EDIT: O_O PENSE QUE LE RESPONDERIA RAPIDO jaja 3 mensajes |
D:\Documents and Settings\Administrador\Mis documentos\Descargas\samp03x_svr_RC1_win32\filterscripts\test_cmds.pwn(135) : warning 217: loose indentation D:\Documents and Settings\Administrador\Mis documentos\Descargas\samp03x_svr_RC1_win32\filterscripts\test_cmds.pwn(135) : error 029: invalid expression, assumed zero D:\Documents and Settings\Administrador\Mis documentos\Descargas\samp03x_svr_RC1_win32\filterscripts\test_cmds.pwn(135) : error 017: undefined symbol "cmd_setweapon" D:\Documents and Settings\Administrador\Mis documentos\Descargas\samp03x_svr_RC1_win32\filterscripts\test_cmds.pwn(135) : error 029: invalid expression, assumed zero D:\Documents and Settings\Administrador\Mis documentos\Descargas\samp03x_svr_RC1_win32\filterscripts\test_cmds.pwn(135) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
CMD:setweapon(playerid, params[])
#include <a_samp> #include <core> #include <float> #include <sscanf> #include <zcmd> #include "../include/gl_common.inc"