AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Mismatch? (https://forums.alliedmods.net/showthread.php?t=46831)

Drak 11-03-2006 15:57

Mismatch?
 
I'm proabbly making a silly mistake, but why am i getting the compile error "Argument mismatch on line 1"
Code:
public set_phone_model(id,function) {         if(equali(function,"g_on")) { // Error is here                    //Model               }     else {         entity_set_string(id,EV_SZ_viewmodel,"")         entity_set_string(id,EV_SZ_weaponmodel,"")         entity_set_int(id,EV_INT_weaponanim,0)     }     return PLUGIN_HANDLED }

teame06 11-03-2006 16:04

Re: Mismatch?
 
in your public set_phone_model function is declare as a int. It need to be function[] to be a string. Since equal only take in strings

Drak 11-03-2006 16:44

Re: Mismatch?
 
Then would i want todo something like:
Code:
if(equal(function,"1")
Since I just want to use 'set_phone_model(id,1)'
To set or remove the model

Greenberet 11-03-2006 17:29

Re: Mismatch?
 
if( function == 1 )

Drak 11-03-2006 19:54

Re: Mismatch?
 
Doh! Thanks.


All times are GMT -4. The time now is 04:47.

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