SA-MP Forums Archive
I Got a warrning, any 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: I Got a warrning, any Help (/showthread.php?tid=348940)



I Got a warrning, any Help - Compton. - 07.06.2012

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
if (strcmp("/v bansh", cmdtext, true, 10) == 0)
{
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "ERROR: You already have a Vehicle");
    if(Veh[playerid] != 0) DestroyVehicle(Veh[playerid]);continue the rest of the command
    new Float:x, Float:y, Float:z, Float:angle;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, angle);
    Veh[playerid] = CreateVehicle(429, x, y, z, angle, 0, 0, 60);
    PutPlayerInVehicle(playerid, Veh[playerid], 0);
    ChangeVehicleColor(Veh[playerid], 2, 1);
    return 1;
}
Now i get this Warning
Quote:

.pwn(243) : warning 209: function "OnPlayerCommandText" should return a value

how can i fix it ?

and how can i add more Commands under it ?

Sory But iam New in Scripiting


Re: I Got a warrning, any Help - Stefand - 07.06.2012

Post it between [.pawn] and [./pawn] without the dots, and show us that line


Re: I Got a warrning, any Help - Compton. - 07.06.2012

OK now its Better ?


Re: I Got a warrning, any Help - Stefand - 07.06.2012

What is line 243??


Re: I Got a warrning, any Help - Compton. - 07.06.2012

It ends at Line 242 But the Waring Gets in the Line 243
I Think its about the Return or some
or somthing is Missing


Re: I Got a warrning, any Help - Stefand - 07.06.2012

O place this under it:
pawn Код:
return 0;
{



Re: I Got a warrning, any Help - MadeMan - 07.06.2012

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/v bansh", cmdtext, true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "ERROR: You already have a Vehicle");
        if(Veh[playerid] != 0) DestroyVehicle(Veh[playerid]);
        new Float:x, Float:y, Float:z, Float:angle;
        GetPlayerPos(playerid, x, y, z);
        GetPlayerFacingAngle(playerid, angle);
        Veh[playerid] = CreateVehicle(429, x, y, z, angle, 0, 0, 60);
        PutPlayerInVehicle(playerid, Veh[playerid], 0);
        ChangeVehicleColor(Veh[playerid], 2, 1);
        return 1;
    }
    if (strcmp("/anothercmd", cmdtext, true) == 0)
    {
        return 1;
    }
    return 0;
}



Re: I Got a warrning, any Help - Compton. - 07.06.2012

thanks