SA-MP Forums Archive
VIP CMD help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: VIP CMD help (/showthread.php?tid=607675)



VIP CMD help - LifeRah - 22.05.2016

hello, i made this CMD for my Vip players so that they can set there weather not everyones:-
PHP код:
CMD:vweather(playerid, params[])
{
 if(
GetPVarInt(playerid, "DonateRank") <= 1)
 {
  
SendClientMessage(playerid, 0xAA3333AA, "You are not a VIP!");
  return 
1;
 }
 new 
weather;
 if(
sscanf(params, "d", weather)) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /vweather [weatherid]");
 if(
weather < 0||weather > 45) { SendClientMessage(playerid, 0xAA3333AA, "Weather ID can't be below 0 or above 45!"); return 1; }
 
SetPlayerWeather(playerid, weather);
 
SendClientMessage(playerid, 0xC2A2DAAA, "Weather Set!");
 return 
1;
} 
but it gives this error:-
PHP код:
D:\michael\filterscripts\Command(2).pwn(58) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664     Copyright (c) 1997-2006, ITB CompuPhase
1 Error
. 
And this the line where the error is coming:-
PHP код:
if(sscanf(params, "d", weather)) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /vweather [weatherid]"); 
kindly tell me how to fix it?


Re: VIP CMD help - justjamie - 22.05.2016

Weather id's are an interger.
So this would become the line:

PHP код:
if(sscanf(params, "i", weather)) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /vweather [weatherid]"); 



Re: VIP CMD help - MBilal - 22.05.2016

Quote:
Originally Posted by Travalle
Посмотреть сообщение
hello, i made this CMD for my Vip players so that they can set there weather not everyones:-
PHP код:
CMD:vweather(playerid, params[])
{
 if(
GetPVarInt(playerid, "DonateRank") <= 1)
 {
  
SendClientMessage(playerid, 0xAA3333AA, "You are not a VIP!");
  return 
1;
 }
 new 
weather;
 if(
sscanf(params, "d", weather)) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /vweather [weatherid]");
 if(
weather < 0||weather > 45) { SendClientMessage(playerid, 0xAA3333AA, "Weather ID can't be below 0 or above 45!"); return 1; }
 
SetPlayerWeather(playerid, weather);
 
SendClientMessage(playerid, 0xC2A2DAAA, "Weather Set!");
 return 
1;
} 
but it gives this error:-
PHP код:
D:\michael\filterscripts\Command(2).pwn(58) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664     Copyright (c) 1997-2006, ITB CompuPhase
1 Error
. 
And this the line where the error is coming:-
PHP код:
if(sscanf(params, "d", weather)) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /vweather [weatherid]"); 
kindly tell me how to fix it?
I tested your cmd in my gm i didn't get single error in that.


Re: VIP CMD help - luke49 - 22.05.2016

Quote:
Originally Posted by justjamie
Посмотреть сообщение
Weather id's are an interger.
So this would become the line:

PHP код:
if(sscanf(params, "i", weather)) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /vweather [weatherid]"); 
Both d and i can be an integer.


Re: VIP CMD help - Slawiii - 22.05.2016

try this

PHP код:
CMD:vweather(playerid, params[]) 
{ 
 if(
GetPVarInt(playerid, "DonateRank") <= 1) 
 { 
  
SendClientMessage(playerid, 0xAA3333AA, "You are not a VIP!"); 
  return 
1; 
 } 

 new 
weather; 
 if(
sscanf(params, "d", weather)) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /vweather [weatherid]"); 

 if(
weather < 0 || weather > 45) return SendClientMessage(playerid, 0xAA3333AA, "Weather ID can't be below 0 or above 45!");
 
SetPlayerWeather(playerid, weather); 
 
SendClientMessage(playerid, 0xC2A2DAAA, "Weather Set!"); 
 return 
1; 
} 



Re: VIP CMD help - LifeRah - 22.05.2016

still getting the same error:-
PHP код:
D:\michaelwcrp\filterscripts\Command(2).pwn(58) : warning 217: loose indentation
D
:\michaelwcrp\filterscripts\Command(2).pwn(58) : error 035: argument type mismatch (argument 1)
D:\michaelwcrp\filterscripts\Command(2).pwn(60) : warning 217: loose indentation
Pawn compiler 3.2.3664              Copyright 
(c) 1997-2006, ITB CompuPhase

1 Error
. 



Re: VIP CMD help - iKevin - 22.05.2016

Quote:
Originally Posted by Slawiii
Посмотреть сообщение
try this

PHP код:
CMD:vweather(playerid, params[]) 
{ 
 if(
GetPVarInt(playerid, "DonateRank") <= 1) 
 { 
  
SendClientMessage(playerid, 0xAA3333AA, "You are not a VIP!"); 
  return 
1; 
 } 
 new 
weather; 
 if(
sscanf(params, "d", weather)) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /vweather [weatherid]"); 
 if(
weather < 0 || weather > 45) return SendClientMessage(playerid, 0xAA3333AA, "Weather ID can't be below 0 or above 45!");
 
SetPlayerWeather(playerid, weather); 
 
SendClientMessage(playerid, 0xC2A2DAAA, "Weather Set!"); 
 return 
1; 
} 
You just changed the messages from inbrackets to returning option.


Re: VIP CMD help - luke49 - 22.05.2016

Align your script and you will not get any loose indentation warnings.
PHP код:
CMD:vweather(playerid, params[])
{
    if(
GetPVarInt(playerid, "DonateRank") <= 1)
    {
         
SendClientMessage(playerid, 0xAA3333AA, "You are not a VIP!");
         return 
1;
    }
    new 
weather;
    if(
sscanf(params, "d", weather)) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /vweather [weatherid]");
    if(
weather < 0||weather > 45) { SendClientMessage(playerid, 0xAA3333AA, "Weather ID can't be below 0 or above 45!"); return 1; }
    
SetPlayerWeather(playerid, weather);
    
SendClientMessage(playerid, 0xC2A2DAAA, "Weather Set!");
    return 
1;
} 



Re: VIP CMD help - oMa37 - 22.05.2016

Try this, worked fine for me.

PHP код:
CMD:vweather(playerid, params[]) 
{ 
     if(
GetPVarInt(playerid, "DonateRank") <= 1) return SendClientMessage(playerid, 0xAA3333AA, "You are not a VIP!"); 

     new 
weather; 
     if(
sscanf(params, "d", weather)) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /vweather [weatherid]"); 

     if(
weather < 0||weather > 45) { SendClientMessage(playerid, 0xAA3333AA, "Weather ID can't be below 0 or above 45!"); return 1; } 
     
SetPlayerWeather(playerid, weather); 
     
SendClientMessage(playerid, 0xC2A2DAAA, "Weather Set!"); 
     return 
1; 
} 



Re: VIP CMD help - iKevin - 22.05.2016

Код:
CMD:vweather(playerid, params[]) 
{ 
 	if(GetPVarInt(playerid, "DonateRank") <= 1) return SendClientMessage(playerid, 0xAA3333AA, "You are not a VIP!"); 

 	new weather; 
 	if(sscanf(params, "d", weather)) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /vweather [weatherid]"); 

 	if(weather < 0||weather > 45) { SendClientMessage(playerid, 0xAA3333AA, "Weather ID can't be below 0 or above 45!"); return 1; } 
 	SetPlayerWeather(playerid, weather); 
 	SendClientMessage(playerid, 0xC2A2DAAA, "Weather Set!"); 
 	return 1; 
}
EDIT: Too late.