Raised This Month: $ Target: $400
 0% 

Help with file-read


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Grinf4ce
Senior Member
Join Date: May 2006
Old 12-05-2007 , 15:27   Help with file-read
Reply With Quote #1

Hello there,
i'm a new little coder and want to recode a plugin.
Its this: Hats

I tried to give every player a hat when he spawn first time on map.

Originalfunction of Hats:
PHP Code:
public Give_Hat(id)
{
    new 
smodelnum[5], name[32]
    
read_argv(1,name,31)
    
read_argv(2,smodelnum,4)
    
    new 
player cmd_target(id,name,2)
    if (!
player) {
        
client_print(id,print_chat,"[%s] Player With That Name Does Not Exist.",PLUG_TAG)
        return 
PLUGIN_HANDLED
    
}
    
    new 
imodelnum = (str_to_num(smodelnum))
    if (
imodelnum MAX_HATS) return PLUGIN_HANDLED
    
    Set_Hat
(player,imodelnum,id)

    return 
PLUGIN_CONTINUE

But i only get the error "[HATS] Player With That Name Does not Exist" when i join the server and spawn the first time.
How i had to modify the command, which i send to client @ first spawn?
PHP Code:
 new nick[33]
 new 
model[2]
 
 
get_user_name (id,nick,32)
 
model "1"// Automatic Modelnr 1
 
 
client_cmd(id,"amx_givehat #%n %m",id,model
Can someone help a little Codingnoob? :-/
Please.

Greets, Grinf4ce
__________________
Grinf4ce 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 11:09.


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