House CP Help Me To Fix it +Reps
#1

Hi Scripter :*
i Have made my own script house Dynamic CP And Exit CP
There Errors Can somone help me Please ?
i Made it When i Write /createhouse > set interior and set CP Exit AutoMatic Exit CP its otmatic made
Quote:

(7) : error 021: symbol already defined: "house1Exit"
(17) : error 035: argument type mismatch (argument 1)
(2 : error 035: argument type mismatch (argument 1)
(36) : error 017: undefined symbol "house2Exit"
(57) : error 017: undefined symbol "house2Exit"

Line 7 >
PHP код:
new house2Enthouse1Exit
Line 17 >
PHP код:
if(!strcmp(type"enter"true)) 
Line 28 >
PHP код:
if(!strcmp(type"exit"true)) 
Line 36 >
PHP код:
house2Exit CreateDynamicCP(x,y,z,2.0,GetPlayerVirtualWorld(playerid),-1,-1,100.0); 
Line 57 >
PHP код:
else if(checkpointid == house2Exit
Full Code
PHP код:
#include <a_samp>
#include <Streamer>
#include <zcmd>
#include <sscanf2>
new house1Enthouse1Exit;
new 
house2Enthouse1Exit;
CMD:createhouse(playeridparams[])
{
    new 
interiortype;
    new 
Float:xFloat:yFloat:z;
    if(
sscanf(params,"is"interiortype)) return SendClientMessage(playerid, -1"/createhouse [1~2][type]");
    if(
interior 2SendClientMessage(playerid, -1"Invaild Interior ID");
    
GetPlayerPos(playeridxyz);
    if(!
strcmp(type"enter"true))
    {
        if(
interior == 1)
        {
            
house1Ent CreateDynamicCPx,y,z,2.0,GetPlayerVirtualWorld(playerid),-1,-1,100.0);
        }
        else if(
interior == 2)
        {
            
house2Ent CreateDynamicCP(x,y,z,2.0,GetPlayerVirtualWorld(playerid),-1,-1,100.0);
        }
    }
    if(!
strcmp(type"exit"true))
    {
        if(
interior == 1)
        {
            
house1Exit CreateDynamicCPx,y,z,2.0,GetPlayerVirtualWorld(playerid),-1,-1,100.0);
        }
        else if(
interior == 2)
        {
            
house2Exit CreateDynamicCP(x,y,z,2.0,GetPlayerVirtualWorld(playerid),-1,-1,100.0);
        }
    }
    return 
1;
}
public 
OnPlayerEnterDynamicCP(playeridcheckpointid)
{
    if(
checkpointid == house1Ent)
    {
        
SetPlayerInterior(playerid,2);
        
SetPlayerPos(playerid,271.884979,306.631988,999.148437);
    }
    else if(
checkpointid == house2Ent)
    {
        
SetPlayerInterior(playerid,3);
        
SetPlayerPos(playerid,1527.229980,-11.574499,1002.097106 );
    }
    else if(
checkpointid == house1Exit)
    {
        
SetPlayerPos(playerid,272.884979,306.631988,999.148437);
    }
    else if(
checkpointid == house2Exit)
    {
        
SetPlayerPos(playerid,1526.229980,-11.574499,1002.097106);
    }
    return 
1;

Reply
#2

You have already define House1exit, try this

Change
Код:
new house1Ent, house1Exit; 
new house2Ent, house1Exit;
to
Код:
new house1Ent, house1Exit; 
new house2Ent, house2Exit;
Reply
#3

Quote:
Originally Posted by MicroKyrr
Посмотреть сообщение
You have already define House1exit, try this

Change
Код:
new house1Ent, house1Exit; 
new house2Ent, house1Exit;
to
Код:
new house1Ent, house1Exit; 
new house2Ent, house2Exit;
yay thanks i dont see it
but still there 2 errors
PHP код:
(17) : error 035argument type mismatch (argument 1)
(
28) : error 035argument type mismatch (argument 1
line 17 >
PHP код:
if(!strcmp(type"enter"true)) 
line 28 >
PHP код:
if(!strcmp(type"exit"true)) 
Reply
#4

Change
Код:
if(!strcmp(type, "enter", true))
to

Код:
if(strcmp(type, "enter", true))
And change
Код:
if(!strcmp(type, "exit", true))
to
Код:
if(strcmp(type, "exit", true))
Reply
#5

PHP код:
if(!strcmp("/command"command-text)) 
Reply
#6

Quote:
Originally Posted by MicroKyrr
Посмотреть сообщение
Change
Код:
if(!strcmp(type, "enter", true))
to

Код:
if(strcmp(type, "enter", true))
And change
Код:
if(!strcmp(type, "exit", true))
to
Код:
if(strcmp(type, "exit", true))
still error :/
PHP код:
(17) : error 035argument type mismatch (argument 1
PHP код:
(28) : error 035argument type mismatch (argument 1
PHP код:
if(strcmp(type"enter"true)) 
PHP код:
if(strcmp(type"exit"true)) 
:/
Reply
#7

Try
Код:
if(strcmp(params, "enter", true)
if(strcmp(params, "exit", true)
Reply
#8

Quote:
Originally Posted by MicroKyrr
Посмотреть сообщение
Change
Код:
if(!strcmp(type, "enter", true))
to

Код:
if(strcmp(type, "enter", true))
And change
Код:
if(!strcmp(type, "exit", true))
to
Код:
if(strcmp(type, "exit", true))
That's wrong.

-

You must declare type as string.

PHP код:
new interiortype[16]; 
You must also keep the exclamation point.

PHP код:
if(!strcmp(type"enter"true)) 
PHP код:
if(!strcmp(type"exit"true)) 
Reply
#9

I thought preposterous Anyway,thanks for correcting
Reply
#10

Quote:
Originally Posted by zPain
Посмотреть сообщение
That's wrong.

-

You must declare type as string.

PHP код:
new interiortype[16]; 
You must also keep the exclamation point.

PHP код:
if(!strcmp(type"enter"true)) 
PHP код:
if(!strcmp(type"exit"true)) 
no errors in compile but now i try it on my server its not make the CP why ? and give me this message and i write /createhouse 1 i try the 2 house to create not work :/
PHP код:
/createhouse [1~2][type
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)