Raised This Month: $ Target: $400
 0% 

[ZP] Ayuda crear comando de asignación


  
 
 
Thread Tools Display Modes
Author Message
XCristiaNX
Veteran Member
Join Date: Dec 2009
Old 02-17-2011 , 16:46   Re: [ZP] Ayuda crear comando de asignación
#1

PHP Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
    
register_plugin("Dar nivel""1.0""El que quieras");
    
register_clcmd ("zp_darnivel""cmddarnivel");
}

public 
cmddarnivel(id)
{
    if(!
get_user_flags(id) & !ADMIN_IMMUNITY// Si no tenes el privilegio "a" no lo podes usar
        
return;

    new 
Name[32], Amount[10]; // Las variables

    
read_argv 1Namecharsmax(Name)); // El nombre del player q le vas a asignar el nivel
    
read_argv 2Amountcharsmax(Amount)); // El valor del nivel q se va a asignar

    
new Target cmd_target (idName2); // Conseguimos el player

    
tuvariabledenivel[Target] = str_to_num(Amount); // Le setiamos el valor asignado

    // PD: Esto funciona poniendo zp_darnivel XCristiaNX 8 en consola
    // Comando: zp_darnivel
    // Target: XCristiaNX
    // Valor: 8

    
return PLUGIN_HANDLED;

Saludos
XCristiaNX is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:37.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode