SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 12/02/2014, 09:23 AM   #1
alishvasis
Huge Clucker
 
alishvasis's Avatar
 
Join Date: Jan 2014
Location: Netherlands
Posts: 311
Reputation: 5
Flowers 1 Warning Help tNx

Hi Why Give Me a Error ? Help Me + Rep TnX :Xx

This is Code:
Code:
if(Account[playerid][pAdminlevel] == 1)
    {
	#pragma unused params
	for(new car = 1; car <= 268; car++)
        {
                if(IsVehicleEmpty(car)) SetVehicleToRespawn(car);
        }
        			        GetPlayerName(playerid, name, sizeof(name));
					format(string, sizeof(string), "[News] {FF0000}loaded allcars By %s .",name);
					SendClientMessageToAll(COLOR_PINK, string);
        			return 1;
	}
	return 1;
}
stock IsVehicleEmpty(vehicleid)
{
        for(new i=0; i<MAX_PLAYERS; i++)
        {
                if(IsPlayerInVehicle(i, vehicleid)) return 0;
        }
        return 1;
}
And Give Me This warning:

Code:
warning 217: loose indentation

At This Line :
Code:
 GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "[News] {FF0000}loaded allcars By %s .",name);
SendClientMessageToAll(COLOR_PINK, string);
alishvasis is offline   Reply With Quote
Old 12/02/2014, 09:31 AM   #2
MattTucker
Huge Clucker
 
Join Date: Oct 2013
Location: nowhere:c
Posts: 202
Reputation: 28
Default Re: 1 Warning Help tNx

pawn Code:
if(Account[playerid][pAdminlevel] == 1)
{
    new string[128], name[MAX_PLAYER_NAME];
    #pragma unused params
    for(new car = 1; car <= 268; car++)
    {
        if(IsVehicleEmpty(car)) SetVehicleToRespawn(car);
    }
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[News] {FF0000}loaded allcars By %s .",name);
    SendClientMessageToAll(COLOR_PINK, string);
    return 1; // I think this one is not needed
    }
    return 1;
}

If you already have a line having "new string[128], name[MAX_PLAYER_NAME]; " no need to add this line, and I actually assume that warning came out because of your space-ing.
MattTucker is offline   Reply With Quote
Old 12/02/2014, 09:37 AM   #3
rakshith122
Huge Clucker
 
Join Date: Nov 2013
Location: Soviet Russia
Posts: 224
Reputation: 4
Default Re: 1 Warning Help tNx

Quote:
Originally Posted by alishvasis View Post
Hi Why Give Me a Error ? Help Me + Rep TnX :Xx

If you get the warnings at this line
Code:
 GetPlayerName(playerid, name, sizeof(name));
Then just delete the " " space before
Code:
 GetPlayerName(playerid,name,sizeof(name));
So, It should be like
pawn Code:
GetPlayerName(playerid, name, sizeof(name));
Use this ^

Code:
 GetPlayerName(playerid, name, sizeof(name));
It should not be like this ^
rakshith122 is offline   Reply With Quote
Old 12/02/2014, 09:54 AM   #4
alishvasis
Huge Clucker
 
alishvasis's Avatar
 
Join Date: Jan 2014
Location: Netherlands
Posts: 311
Reputation: 5
Default Re: 1 Warning Help tNx

Quote:
Originally Posted by rakshith122 View Post
Then just delete the " " space before
Code:
 GetPlayerName(playerid,name,sizeof(name));
So, It should be like
pawn Code:
GetPlayerName(playerid, name, sizeof(name));
Use this ^

Code:
 GetPlayerName(playerid, name, sizeof(name));
It should not be like this ^
TnX I Reped You LAst Week
I Cant Rep You Again In This Furom
alishvasis is offline   Reply With Quote
Old 12/02/2014, 09:56 AM   #5
rakshith122
Huge Clucker
 
Join Date: Nov 2013
Location: Soviet Russia
Posts: 224
Reputation: 4
Default Re: 1 Warning Help tNx

HUEHUEHUE, Remember to do it later :P
rakshith122 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
[Warning] Wild Warning Appears. $Marco$ Scripting Help 5 21/01/2014 05:47 PM
warning 215: expression has no effect & warning 235: public function lacks forward declaration botak Scripting Help 4 27/12/2013 12:38 PM
[Ajuda] Warning: warning 225: unreachable code fackbook Português/Portuguese 6 18/01/2013 10:11 PM
[warning]como tira esse warning?? syslogg Português/Portuguese 3 06/01/2011 12:59 AM


All times are GMT. The time now is 04:43 PM.


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