OnPlayerCommandText
#1

hi, well i have this script

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp("/repair", cmdtext))
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
RepairVehicle(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");
return 1;
}
}

and i get this warning


C:\Documents and Settings\Oni\My Documents\Downloads\samp03asvr_R8_win32\gamemodes\ Awesome.pwn(6 : warning 209: function "OnPlayerCommandText" should return a value
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.


line 68 is this

} (this is the last one)

can you help me, (also can i make it dcmd, i really need it)
Reply
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
   if (!strcmp("/repair", cmdtext))
   {
      if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
      RepairVehicle(GetPlayerVehicleID(playerid));
      SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");
      return 1;
   }
   return 0;
}
Reply
#3

Thank you
Reply
#4

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
 if (!strcmp("/repair", cmdtext))
 {
  if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
  RepairVehicle(GetPlayerVehicleID(playerid));
  SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");
  return 1;
  }
return 0;
}
Always return a 0 on OnPlayerCommandText

EDIT : Sorry, didn't know it was quick reply D:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)