Scripting Errors
#9

Try This

PHP код:

CMD
:siren(playeridparams[]) 
    if 
IsACop(playerid) || PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == 12
    { 
        new 
string[128], type
        new 
VID GetPlayerVehicleID(playerid); 
        if(
sscanf(params"d"type)) 
        { 
            
SendClientMessageEx(playeridCOLOR_WHITE"USAGE: /siren [type]"); 
            
SendClientMessageEx(playeridCOLOR_GRAD2"Type: 1 = Small (Inside Dashbord), 2 = Large (Roof), 3 = Off."); 
            return 
1
        } 
        switch(
type
        { 
            case 
1
            { 
                if(
Siren[VID] == 1
                { 
                    
SendClientMessageEx(playeridCOLOR_GRAD2"This vehicle already has a siren!"); 
                    return 
1
                } 
                new 
sendername[MAX_PLAYER_NAME]; 
                
Siren[VID] = 1
                
GetPlayerName(playeridsendernamesizeof(sendername)); 
                
SirenObject[VID] = CreateObject(1864610.010.010.0000); 
                
AttachObjectToVehicle(SirenObject[VID], VID0.00.750.2750.00.10.0); 
                
format(stringsizeof(string), "* %s puts the siren on the dashboard."sendername); 
                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); 
                return 
1
            } 
            case 
2
            { 
                if(
Siren[VID] == 1
                { 
                    
SendClientMessageEx(playeridCOLOR_GRAD2"This vehicle already has a siren!"); 
                    return 
1
                } 
                
Siren[VID] = 1
                new 
sendername[MAX_PLAYER_NAME]; 
                
GetPlayerName(playeridsendernamesizeof(sendername)); 
                
SirenObject[VID] = CreateObject(19419000000); 
                
AttachObjectToVehicle(SirenObject[VID], VID0.009999, -0.0199990.9449990.0000000.0000000.000000); 
                
format(stringsizeof(string), "* %s puts the siren on the roof."sendername); 
                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); 
                return 
1
            } 
            case 
3
            { 
                if(
Siren[VID] == 0
                { 
                    
SendClientMessageEx(playeridCOLOR_GRAD2"This vehicle doesn't have a siren on it!"); 
                    return 
1
                } 
                
Siren[VID] = 0
                new 
sendername[MAX_PLAYER_NAME]; 
                
GetPlayerName(playeridsendernamesizeof(sendername)); 
                
DestroyObject(SirenObject[VID]); 
                
format(stringsizeof(string), "* %s takes down the siren."sendername); 
                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); 
                return 
1
            } 
            default: 
            { 
                
SendClientMessageEx(playeridCOLOR_WHITE"Invalid license type! /siren [type]"); 
                
SendClientMessageEx(playeridCOLOR_GRAD2"Type: 1 = Roof, 2 = Inside, 3 = Off."); 
            } 
        } 
    } 
    else 
SendClientMessageEx(playeridCOLOR_GREY"You're not authorised to use this command."); 
    return 
1

Reply


Messages In This Thread
Scripting Errors - by KeenanRitchie - 10.11.2012, 22:56
Re: Scripting Errors - by Team_PRO - 10.11.2012, 23:03
Re: Scripting Errors - by JakeMiller - 10.11.2012, 23:07
Re: Scripting Errors - by Team_PRO - 10.11.2012, 23:09
Re: Scripting Errors - by KeenanRitchie - 10.11.2012, 23:09
Re: Scripting Errors - by Team_PRO - 10.11.2012, 23:11
Re: Scripting Errors - by KeenanRitchie - 10.11.2012, 23:14
Re: Scripting Errors - by Team_PRO - 10.11.2012, 23:21
Re: Scripting Errors - by Team_PRO - 10.11.2012, 23:24
Re: Scripting Errors - by KeenanRitchie - 10.11.2012, 23:24

Forum Jump:


Users browsing this thread: 3 Guest(s)