I Got a warrning, any Help
#1

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
Reply
#2

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

OK now its Better ?
Reply
#4

What is line 243??
Reply
#5

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
Reply
#6

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

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;
}
Reply
#8

thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)