SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 05/09/2013, 09:12 PM   #1
bustern
Gangsta
 
Join Date: Aug 2013
Location: Bulgaria
Posts: 549
Reputation: 39
Default Why this script doesnt work ?

PHP Code:
CMD:vcolor(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] < 3) return 0;
    new 
color1color2;
    if(
sscanf(params,"ui"color1color2)) return SendClientMessage(playeridCOLOR_RED,"USAGE: /vcolor [COLOR 1] [COLOR 2]");
     
ChangeVehicleColor(GetPlayerVehicleID(playerid),color1,color2);
     
SendClientMessage(playerid,COLOR_BLUE,"Your car was resprayed");
    return 
1;

__________________
My works:
iTune, tune any vehicle IG, unseen script - http://forum.sa-mp.com/showthread.php?t=571633
Roleplay website template with webshop - http://forum.sa-mp.com/showthread.php?t=533758
UNIQUE BC:RP Gamemode - http://forum.sa-mp.com/showthread.php?t=492329
DeathMatch GM with a lot of commands - http://forum.sa-mp.com/showthread.php?t=462554
Movable doors,gate,barier,objects near LSPD and CityHall ! - http://forum.sa-mp.com/showthread.php?t=460897
DM arena - http://forum.sa-mp.com/showthread.php?t=461746
Weapon shop - http://forum.sa-mp.com/showthread.php?t=459375
New weapon shop - http://forum.sa-mp.com/showthread.php?t=459513
Tele Menu - http://forum.sa-mp.com/showthread.php?t=459683
bustern is offline   Reply With Quote
Old 05/09/2013, 09:23 PM   #2
Pawnie
Big Clucker
 
Join Date: Mar 2013
Posts: 177
Reputation: 3
Default Re: Why this script doesnt work ?

Try something like this

pawn Code:
CMD:vcolor(playerid,params[])
{
    new color[2];
    if(PlayerInfo[playerid][pAdmin] < 3)
    {
        if(sscanf(params,"ii",color[0],color[1])) return SendClientMessage(playerid,0xFFFFFFFF,"Use: /vcolor [color1] [color2]");
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFFFFFFFF,"You need to be in vehicle to use this command!");
        ChangeVehicleColor(GetPlayerVehicleID(playerid),color[0],color[1]);

    }
    return 1;
}

The problem should be here
Code:
if(sscanf(params,"ui", color1, color2))
Change ui to ii
__________________
[Tutorial] Player Score
Pawnie is offline   Reply With Quote
Old 05/09/2013, 09:39 PM   #3
bustern
Gangsta
 
Join Date: Aug 2013
Location: Bulgaria
Posts: 549
Reputation: 39
Default Re: Why this script doesnt work ?

Works, thank you.
__________________
My works:
iTune, tune any vehicle IG, unseen script - http://forum.sa-mp.com/showthread.php?t=571633
Roleplay website template with webshop - http://forum.sa-mp.com/showthread.php?t=533758
UNIQUE BC:RP Gamemode - http://forum.sa-mp.com/showthread.php?t=492329
DeathMatch GM with a lot of commands - http://forum.sa-mp.com/showthread.php?t=462554
Movable doors,gate,barier,objects near LSPD and CityHall ! - http://forum.sa-mp.com/showthread.php?t=460897
DM arena - http://forum.sa-mp.com/showthread.php?t=461746
Weapon shop - http://forum.sa-mp.com/showthread.php?t=459375
New weapon shop - http://forum.sa-mp.com/showthread.php?t=459513
Tele Menu - http://forum.sa-mp.com/showthread.php?t=459683
bustern is offline   Reply With Quote
Old 05/09/2013, 10:06 PM   #4
CaveDweller
Big Clucker
 
Join Date: May 2013
Posts: 77
Reputation: 9
Default Re: Why this script doesnt work ?

I suggest you read the specifiers section on the sscanf thread.
CaveDweller is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why this script doesnt work ? bustern Scripting Help 5 28/08/2013 07:32 PM
Edited script doesnt work NicholasA Scripting Help 11 18/05/2013 02:40 PM
WC-RP Script doesnt work Sweez Scripting Help 0 15/02/2013 10:41 AM
Same script doesnt work on linux same as in window servers Voldemort Scripting Help 0 25/11/2011 06:30 PM


All times are GMT. The time now is 02:11 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.