Raised This Month: $51 Target: $400
 12% 

errors 29 and 30


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 05-23-2006 , 07:05   errors 29 and 30
Reply With Quote #1

Code:
/home/users/amxmodx/tmp3/phpoc1ShG.sma(31) : error 035: argument type mismatch (argument 1)
/home/users/amxmodx/tmp3/phpoc1ShG.sma(31) : error 029: invalid expression, assumed zero
/home/users/amxmodx/tmp3/phpoc1ShG.sma(31 -- 32) : error 029: invalid expression, assumed zero
/home/users/amxmodx/tmp3/phpoc1ShG.sma(31 -- 32) : fatal error 107: too many error messages on one line

Compilation aborted.
4 Errors.
Could not locate output file /home/groups/amxmodx/public_html/websc3/phpoc1ShG.amx (compile failed).
and part of my script with the error
Code:
public client_infochanged(id)     {     new newName[33]     get_user_info(id,"name",newName,32)         if(get_user_frags("5")) && (contain(newName,"Cpl.") == -1)     {         get_user_info(id, "name",newName,32)                 client_print(id, print_chat, "Congratulations Private! You are now promoted to Corporal!")         format(newName,32,"Cpl. %s",newName)         client_cmd(id,"name %s",newName)     } } public client_putinserver(id)     client_infochanged(id)
__________________
It's a mystery.
Mini_Midget is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-23-2006 , 08:42  
Reply With Quote #2

This is my best guess on what you're trying to do, but I don't know:

Code:
#include <amxmodx> #include <amxmisc> public client_infochanged(id) {     new newName[33]     get_user_info(id,"name",newName,32)           if(get_user_frags(id) >= 5 && contain(newName,"Cpl.") == -1)     {         get_user_info(id, "name",newName,32)                   client_print(id, print_chat, "Congratulations Private! You are now promoted to Corporal!")         format(newName,32,"Cpl. %s",newName)         client_cmd(id,"name %s",newName)     } } public client_putinserver(id)     client_infochanged(id)
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 05-23-2006 , 09:14  
Reply With Quote #3

when i get 5+ frags and it says that i'm promoted
i look at the score board to see if my name was changed
it changed but just "Cpl."
no "Mini_Midget" or whats so ever
can't see where i went wrong now...
btw, thxs for the last post
__________________
It's a mystery.
Mini_Midget is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-23-2006 , 09:22  
Reply With Quote #4

Quote:
Originally Posted by Mini_Midget
when i get 5+ frags and it says that i'm promoted
i look at the score board to see if my name was changed
it changed but just "Cpl."
no "Mini_Midget" or whats so ever
can't see where i went wrong now...
btw, thxs for the last post
Change the client_cmd to this:

Code:
client_cmd(id,"name ^"%s^"",newName)
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Zenith77
Veteran Member
Join Date: Aug 2005
Old 05-23-2006 , 16:50  
Reply With Quote #5

To preserve the old name, and replace w/e rank with Cpl.; you need to do this...

Code:
//a little snippet new oldName[32]; get_user_name(id, oldName, 31); if(containi(oldName, "Pvt.") > -1)      replace(oldName, 3, "Pvt.", ""); new name[32]; format(name, 31, "Cpl. %s", oldName);

__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-23-2006 , 20:02  
Reply With Quote #6

Why don't you just replace Pvt. with Cpl., the end part you used is useless.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 05-24-2006 , 05:29  
Reply With Quote #7

thxs everyone who helped me out especially Hawk
the plugin works fine now and i added some things but now i've come across a bug in my plugin
when i start a new game, my name is Pte. Mini_Midget
(Pte. means Private) and when I get my first kill in the server, my rank
and name should change to "Cpl. Mini_Midget" but instead it changes to
"Cpl. Pte. Mini_Midget". i change my name and then it resets back to normal "Cpl. Mini_Midget"
btw, when a user connects, i can't get the client_print code to show in game

Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN  "Army Ranks" #define VERSION "0.1" #define AUTHOR  "Mini_Midget" public plugin_init()     {     register_plugin(PLUGIN, VERSION, AUTHOR); } public client_connect(id)     {     new newName[33]     get_user_info(id,"name",newName,32)         if(containi(newName,"Pte.") == -1)         {         format(newName,32,"Pte. %s",newName)         set_user_info(id,"name",newName)            client_print(id, print_chat, "G'day Private %s", newName)     } } public client_infochanged(id)     {     new newName[33]     get_user_info(id,"name",newName,32)         if(get_user_frags(id) >= 1 && containi(newName,"Cpl.") == -1)         {         format(newName,32,"Cpl. %s",newName)         set_user_info(id,"name",newName)          client_print(id, print_chat, "Congratulations Private! You are now promoted to Corporal!")     } } public client_putinserver(id)     set_task(20.0,"client_infochanged",id)
i forgot to credit hawk for doing the part when a user connects and he changes his name
http://forums.alliedmods.net/showthread.php?t=28761
__________________
It's a mystery.
Mini_Midget is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-24-2006 , 08:27  
Reply With Quote #8

You should have read what Zenith said.

Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN    "Army Ranks" #define VERSION    "0.1" #define AUTHOR    "Mini_Midget" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR) } public client_connect(id) {     new newName[33]     get_user_info(id,"name",newName,32)         if(containi(newName,"Pte.") == -1)     {         format(newName,32,"Pte. %s",newName)         set_user_info(id,"name",newName)            client_print(id, print_chat, "G'day Private %s", newName)     } } public client_infochanged(id)  {      new newName[33]     get_user_info(id,"name",newName,32)         if(get_user_frags(id) >= 1 && containi(newName,"Cpl.") == -1)     {         if(containi(newName,"Pte.") != -1)         {             replace(newName,32,"Pte.","Cpl.")             set_user_info(id,"name",newName)                         client_print(id, print_chat, "Congratulations Private! You are now promoted to Corporal!")         }         else         {                format(newName,32,"Cpl. %s",newName)             set_user_info(id,"name",newName)                            client_print(id, print_chat, "You are now promoted to Corporal!")         }     } }  public client_putinserver(id)      set_task(20.0,"client_infochanged",id)
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 05-24-2006 , 08:30  
Reply With Quote #9

i kinda didn't understand zenith (no offence) so i just played around with the script and got it to work after like 20mins of screwing wiht it
btw, in the script, what does this symbol do "^"???
__________________
It's a mystery.
Mini_Midget is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-24-2006 , 08:32  
Reply With Quote #10

Quote:
Originally Posted by Mini_Midget
i kinda didn't understand zenith (no offence) so i just played around with the script and got it to work after like 20mins of screwing wiht it
btw, in the script, what does this symbol do "^"???
In this console, you can do:

Code:
amx_ban 0 "player name" "you are an idiot"
But in Pawn, look at how the syntax highlighting fucks up when we use quotes inside it:

Code:
server_cmd("ban 0 "player name" "you are an idiot"")

Why? Because quotes signify the end of the string. So, what we do is use an "escape character", which is ' ^" '.

Code:
server_cmd("ban 0 ^"player name^" ^"you are an idiot^"")
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Reply



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 07:28.


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