How could I remove these?
#1

Here are the errors:

Код:
C:\Documents and Settings\Callum\Desktop\GM Scrath\callumspd.pwn(22) : warning 209: function "OnPlayerCommandText" should return a value
C:\Documents and Settings\Callum\Desktop\GM Scrath\callumspd.pwn(22) : error 010: invalid function or declaration
C:\Documents and Settings\Callum\Desktop\GM Scrath\callumspd.pwn(56) : warning 203: symbol is never used: "dcmd_unimpound"
Here is the code:
From line 20 to the end.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
dcmd(impound, 7, cmdtext);
dcmd(unimpound, 9, cmdtext);

dcmd_impound(playerid, params[])
{
    new  engine,lights,alarm,doors,bonnet,boot,objective;
    new vid, id, idn[MAX_PLAYER_NAME], n[MAX_PLAYER_NAME], str[288];
    id = (strval(params));
    GetPlayerName(playerid, n, sizeof(n));
    if(!strlen(params)) return SendClientMessage(playerid, 0xFF0000, "USAGE: /impound <playerid>");
    if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, 0xFF0000, "Player Is not in vehicle");
    vid = GetPlayerVehicleID(id);
    GetPlayerName(id, idn, sizeof(idn));
    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,0,lights,alarm,doors,bonnet,boot,objective);
    format(str,sizeof(str),"%s has impounded %s's vehicle", n, idn);
    SendClientMessageToAll(0x0000FFAA, str);
    return 1;
}
dcmd_unimpound(playerid, params[])
{
    new  engine,lights,alarm,doors,bonnet,boot,objective;
    new vid, id, idn[MAX_PLAYER_NAME], n[MAX_PLAYER_NAME], str[245];
    id = (strval(params));
    GetPlayerName(playerid, n, sizeof(n));
    if(!strlen(params)) return SendClientMessage(playerid, 0xFF0000, "USAGE: /unimpound <playerid>");
    if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, 0xFF0000, "Player Is not in vehicle");
    vid = GetPlayerVehicleID(id);
    GetPlayerName(id, idn, sizeof(idn));
    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet,boot,objective);
    format(str, sizeof(str), "%s has unimpounded %s's vehicle", n, idn);
    SendClientMessageToAll(0x0000FFAA, str);
    return 1;
}
Reply
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(impound, 7, cmdtext);
dcmd(unimpound, 9, cmdtext);
}

dcmd_impound(playerid, params[])
{
    new  engine,lights,alarm,doors,bonnet,boot,objective;
    new vid, id, idn[MAX_PLAYER_NAME], n[MAX_PLAYER_NAME], str[288];
    id = (strval(params));
    GetPlayerName(playerid, n, sizeof(n));
    if(!strlen(params)) return SendClientMessage(playerid, 0xFF0000, "USAGE: /impound <playerid>");
    if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, 0xFF0000, "Player Is not in vehicle");
    vid = GetPlayerVehicleID(id);
    GetPlayerName(id, idn, sizeof(idn));
    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,0,lights,alarm,doors,bonnet,boot,objective);
    format(str,sizeof(str),"%s has impounded %s's vehicle", n, idn);
    SendClientMessageToAll(0x0000FFAA, str);
    return 1;
}
dcmd_unimpound(playerid, params[])
{
    new  engine,lights,alarm,doors,bonnet,boot,objective;
    new vid, id, idn[MAX_PLAYER_NAME], n[MAX_PLAYER_NAME], str[245];
    id = (strval(params));
    GetPlayerName(playerid, n, sizeof(n));
    if(!strlen(params)) return SendClientMessage(playerid, 0xFF0000, "USAGE: /unimpound <playerid>");
    if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, 0xFF0000, "Player Is not in vehicle");
    vid = GetPlayerVehicleID(id);
    GetPlayerName(id, idn, sizeof(idn));
    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet,boot,objective);
    format(str, sizeof(str), "%s has unimpounded %s's vehicle", n, idn);
    SendClientMessageToAll(0x0000FFAA, str);
    return 1;
}
Reply
#3

the command dont need to be in a callback(public)
take the dcmd_impound command and dcmd_unimpound command under OnPlayerCommandText , not in it.
Reply
#4

Quote:
Originally Posted by 6d
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(impound, 7, cmdtext);
dcmd(unimpound, 9, cmdtext);
}

dcmd_impound(playerid, params[])
{
    new  engine,lights,alarm,doors,bonnet,boot,objective;
    new vid, id, idn[MAX_PLAYER_NAME], n[MAX_PLAYER_NAME], str[288];
    id = (strval(params));
    GetPlayerName(playerid, n, sizeof(n));
    if(!strlen(params)) return SendClientMessage(playerid, 0xFF0000, "USAGE: /impound <playerid>");
    if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, 0xFF0000, "Player Is not in vehicle");
    vid = GetPlayerVehicleID(id);
    GetPlayerName(id, idn, sizeof(idn));
    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,0,lights,alarm,doors,bonnet,boot,objective);
    format(str,sizeof(str),"%s has impounded %s's vehicle", n, idn);
    SendClientMessageToAll(0x0000FFAA, str);
    return 1;
}
dcmd_unimpound(playerid, params[])
{
    new  engine,lights,alarm,doors,bonnet,boot,objective;
    new vid, id, idn[MAX_PLAYER_NAME], n[MAX_PLAYER_NAME], str[245];
    id = (strval(params));
    GetPlayerName(playerid, n, sizeof(n));
    if(!strlen(params)) return SendClientMessage(playerid, 0xFF0000, "USAGE: /unimpound <playerid>");
    if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, 0xFF0000, "Player Is not in vehicle");
    vid = GetPlayerVehicleID(id);
    GetPlayerName(id, idn, sizeof(idn));
    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,1,lights,alarm,doors,bonnet,boot,objective);
    format(str, sizeof(str), "%s has unimpounded %s's vehicle", n, idn);
    SendClientMessageToAll(0x0000FFAA, str);
    return 1;
}
Код:
C:\Documents and Settings\Callum\Desktop\GM Scrath\callumspd.pwn(24) : warning 209: function "OnPlayerCommandText" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
I recieve this after doing it.
Reply
#5

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(impound, 7, cmdtext);
    dcmd(unimpound, 9, cmdtext);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)