C:\Users\Win7\Desktop\sa-mp 0.3.7\pawno\include\YSI\..\YSI_Visual\y_commands/impl.inc(229) : error 025: function heading differs from prototype C:\Users\Win7\Desktop\sa-mp 0.3.7\pawno\include\YSI\..\YSI_Visual\y_commands/impl.inc(1329) : error 021: symbol already defined: "@yH_OnScriptInit@003" C:\Users\Win7\Desktop\sa-mp 0.3.7\pawno\include\YSI\..\YSI_Visual\y_commands/impl.inc(1330) : error 021: symbol already defined: "@yH_OnScriptInit@003" C:\Users\Win7\Desktop\sa-mp 0.3.7\pawno\include\YSI\..\YSI_Visual\y_commands/impl.inc(1369) : warning 209: function "@yH_OnScriptInit@003" should return a value C:\Users\Win7\Desktop\Sa-mp 0.3.7\gamemodes\wip.pwn(1654) : error 025: function heading differs from prototype
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
/* List of enum: // The majority of these are even - odd numbers return "1" not "0". COMMAND_ZERO_RET = 0 , // The command returned 0. COMMAND_OK = 1 , // Called corectly. COMMAND_UNDEFINED = 2 , // Command doesn't exist. COMMAND_DENIED = 3 , // Can't use the command. COMMAND_HIDDEN = 4 , // Can't use the command don't let them know it exists. COMMAND_NO_PLAYER = 6 , // Used by a player who shouldn't exist. COMMAND_DISABLED = 7 , // All commands are disabled for this player. COMMAND_BAD_PREFIX = 8 , // Used "/" instead of "#", or something similar. COMMAND_INVALID_INPUT = 10, // Didn't type "/something". */ public e_COMMAND_ERRORS:OnPlayerCommandPerformed(playerid, cmdtext[], e_COMMAND_ERRORS:success); { switch(success) { // case bla bla: /* Example: case COMMAND_DENIED: { Ban(playerid); // Ban them because using our secret command >_< lol } */ } return COMMAND_OK; }
I decided to update to YSI 4.0 and when i did i ran in to some problems while compiling
Код:
C:\Users\Win7\Desktop\sa-mp 0.3.7\pawno\include\YSI\..\YSI_Visual\y_commands/impl.inc(229) : error 025: function heading differs from prototype C:\Users\Win7\Desktop\sa-mp 0.3.7\pawno\include\YSI\..\YSI_Visual\y_commands/impl.inc(1329) : error 021: symbol already defined: "@yH_OnScriptInit@003" C:\Users\Win7\Desktop\sa-mp 0.3.7\pawno\include\YSI\..\YSI_Visual\y_commands/impl.inc(1330) : error 021: symbol already defined: "@yH_OnScriptInit@003" C:\Users\Win7\Desktop\sa-mp 0.3.7\pawno\include\YSI\..\YSI_Visual\y_commands/impl.inc(1369) : warning 209: function "@yH_OnScriptInit@003" should return a value C:\Users\Win7\Desktop\Sa-mp 0.3.7\gamemodes\wip.pwn(1654) : error 025: function heading differs from prototype pawn Код:
|
C:\Users\Win7\Desktop\sa-mp 0.3.7\pawno\include\YSI\..\YSI_Visual\y_commands/impl.inc(1329) : error 021: symbol already defined: "@yH_OnScriptInit@003" C:\Users\Win7\Desktop\sa-mp 0.3.7\pawno\include\YSI\..\YSI_Visual\y_commands/impl.inc(1330) : error 021: symbol already defined: "@yH_OnScriptInit@003" C:\Users\Win7\Desktop\sa-mp 0.3.7\pawno\include\YSI\..\YSI_Visual\y_commands/impl.inc(1369) : warning 209: function "@yH_OnScriptInit@003" should return a value
public OnGameModeInit()
{
#include "../gamemodes/RPG/objects.pwn"
#include "../gamemodes/RPG/buildings.pwn"
ManualVehicleEngineAndLights();
DisableInteriorEnterExits();
mysql_log(LOG_ERROR | LOG_WARNING,LOG_TYPE_HTML);
dbHandle = mysql_connect("127.0.0.1","username","database","password");
if(mysql_errno() != 0)
{
print("Mysql Failed\n");
}
else
{
print("Mysql Success\n");
}
UsePlayerPedAnims();
SetGameModeText("WIP");
SendRconCommand("mapname WIP");
//Timers
SetTimer("NitroReset", 3000, 1);
LoadAll();
printf("Bulldings Removed %d\n", CountRemovedObjects());
textDrawsGlobal();
WorldTime = SetTimer("UpdateWTime", 1000, true);
skinlist = LoadModelSelectionMenu("skins.txt");
vehiclelist = LoadModelSelectionMenu("vehicles.txt");
for(new v=0; v<MAX_VEHICLES; v++)
{
Vehicle_ReadPosition(v);
}
for(new i=0; i<GetMaxPlayers(); i++)
{
textDrawsPlayers(i);
}
return 1;
}
Iter_SafeRemove(Jobs, i, i);
<summary>Iter_SafeRemove</summary> <param name="iter">Name of the iterator to remove data from.</param> <param name="value">Data to remove.</param> <param name="next">Container for the pointer to the next element.</param> <returns> - </returns> <remarks> Wrapper for Iter_SafeRemoveInternal. Common use: Iter_SafeRemove(iter, i, i); native Iter_SafeRemove(Iterator:Name<>, value, &next); </remarks> |
Is it necessary if i'm breaking the loop just after removing the value from the iterator?
|
Is it necessary if i'm breaking the loop just after removing the value from the iterator?
|
Yes. If you don't do it you will still receive errors. Why is it such a big concern anyways? It's just a tad bit more typing.
|
CMD:removeallcars(playerid)
{
foreach (new i : Vehicle) DestroyVehicle(i);
SendClientMessage(playerid, 0xFFFFFFFF, "All vehicles destroyed!");
return 1;
}
pawn Код:
|
stock SafeDestroyVehicle(veh, Iterator:iter<>, &next)
{
if(IsValidVehicle(veh))
Iter_SafeRemove(iter, veh, next);
return DestroyVehicle(veh);
}
//USE:
foreach (new i : Vehicle) SafeDestroyVehicle(i, Vehicle, i);
Carabines.pwn(272) : error 017: undefined symbol "DEFAULT_TEXT_SET" Carabines.pwn(272) : error 017: undefined symbol "FIFTH_CHECKPOINT_DMV_DIALOG" Carabines.pwn(272) : error 029: invalid expression, assumed zero Carabines.pwn(272) : fatal error 107: too many error messages on one line
Text_MessageBox(playerid, using inline OnDMVDialog, $DMV_DIALOG_TITLE, $FIFTH_CHECKPOINT_DMV_DIALOG, $DIALOGS_OK, $DIALOGS_CANCEL); |
FUNCTION:SetPlayerDMVCheckpoint(playerid, CP) { if(CP < 16) { inline OnDMVDialog(pid, dialogid, response, listitem, string:inputtext[]) { // some code return 1; } //SetPlayerRaceCheckpointEx(playerid, 0,DMV_CHECKPOINT[CP][0], DMV_CHECKPOINT[CP][1], DMV_CHECKPOINT[CP][2], DMV_CHECKPOINT[CP+1][0], DMV_CHECKPOINT[CP+1][1], DMV_CHECKPOINT[CP+1][2], 5, CP); if(CP == 5) { Text_MessageBox(playerid, using inline OnDMVDialog, $DMV_DIALOG_TITLE, $FIFTH_CHECKPOINT_DMV_DIALOG, $DIALOGS_OK, $DIALOGS_CANCEL); } else if(CP == 10) Text_Send(playerid, $TENTH_CHECKPOINT_DMV); } else SetPlayerCheckpointEx(playerid, DMV_CHECKPOINT[CP][0], DMV_CHECKPOINT[CP][1], DMV_CHECKPOINT[CP][2], 5, CP); return 1; } |
Hi guys!
Seems like there is one more issue. In y_commands method Command_SetDeniedReturn() is not working. Trunk version. Код:
#include <YSI\y_commands> public OnPlayerConnect (playerid) { Command_SetDeniedReturn(false); return 1; } |