20.08.2013, 20:25
I have this scripted.
And then I have this errors.
Can someone help me?
Код:
public OnPlayerConnect(playerid)
{
new string[128], PlayerName[MAX_PLAYER_NAME]; //This will help defining the GetPlayerName
GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); // It will help getting the player name as above
format(string, sizeof(string), "Drugs/%s.ini", PlayerName); // It will help saving the scores in a file in scriptfiles -> Scores -> player's name.ini
if(fexist(string)) // If that folder exists I think, it command the system to save the player's score(Set it)
{
pInfo[playerid][weed] = dini_Get(string, "Weed");
pInfo[playerid][cocaine] = dini_Get(string, "Cocaine");
pInfo[playerid][ecstasy] = dini_Get(string, "Ecstasy"); // This will save the player's score in the Scores folder and set it.
}
else // Helps for, like if it didn't save + It's like, if that not, or otherwise or something like that
{
dini_Create(string); // Creates a string " "
dini_IntSet(string, "Weed", 0);
dini_IntSet(string, "Cocaine", 0);
dini_IntSet(string, "Ecstasy", 0); // I don't know exactly but as it says above, it doesn't save.
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new string[128], PlayerName[MAX_PLAYER_NAME]; //This will help defining the GetPlayerName
GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); // It will help getting the player name as above
format(string, sizeof(string), "Drugs/%s.ini", PlayerName); // And it helps saving the players' scores inside folder " Scores " into " Player's name.ini ".
if(fexist(string)) // If that folder exists I think, it command the system to save the player's score(Set it)
{
dini_IntSet(string, "Weed", pInfo[playerid][weed]);
dini_IntSet(string, "Cocaine", pInfo[playerid][cocaine]);
dini_IntSet(string, "Ecstasy", pInfo[playerid][ecstasy]); //This will help saving the Score by getting it and saving it inside Score into Player's name.ini %s.ini
}
else // It's like, if that not, or otherwise or something like that
{
dini_Create(string); // Creates a string " "
dini_IntSet(string, "Weed", pInfo[playerid][weed]);
dini_IntSet(string, "Cocaine", pInfo[playerid][cocaine]);
dini_IntSet(string, "Ecstasy", pInfo[playerid][ecstasy]); // It saves the Score of the player in the file
}
}
Код:
C:\Users\Panakos\Desktop\Server\filterscripts\drugs.pwn(42) : error 035: argument type mismatch (argument 2) C:\Users\Panakos\Desktop\Server\filterscripts\drugs.pwn(45) : error 025: function heading differs from prototype C:\Users\Panakos\Desktop\Server\filterscripts\drugs.pwn(46) : error 021: symbol already defined: "strreplace" C:\Users\Panakos\Desktop\Server\filterscripts\drugs.pwn(54) : warning 209: function "strreplace" should return a value C:\Users\Panakos\Desktop\Server\filterscripts\drugs.pwn(103) : error 006: must be assigned to an array C:\Users\Panakos\Desktop\Server\filterscripts\drugs.pwn(104) : error 006: must be assigned to an array C:\Users\Panakos\Desktop\Server\filterscripts\drugs.pwn(105) : error 006: must be assigned to an array C:\Users\Panakos\Desktop\Server\filterscripts\drugs.pwn(462) : warning 203: symbol is never used: "strtok" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 6 Errors.

