11.07.2018, 20:59
Reading the topic i remplace but now i go this errors:
my script
Код HTML:
C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2281) : warning 202: number of arguments does not match definition C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2281) : error 006: must be assigned to an array C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2282) : error 035: argument type mismatch (argument 1) C:\Users\Jaua\Downloads\samp037_svr_R2-1-1_win32\gamemodes\baserp.pwn(2281) : warning 204: symbol is assigned a value that is never used: "tmp" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
PHP код:
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
CMD:addcomponent(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] > 5)
{
new tmp;
tmp = strtok( params );
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /addcomponent [ComponentID]");
return 1;
}
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_CORRECTION, "You are not in a vehicle !");
return 1;
}
{
new componentid;
componentid = strval( params );
new CarId = GetPlayerVehicleID(playerid);
if(componentid < 1000 || componentid > 1193) { SendClientMessage(playerid, COLOR_CORRECTION, "Component ID can't be below 1000 or above 1193 !"); return 1; }
AddVehicleComponent(CarId, componentid);
SendClientMessage(playerid, COLOR_WHITE, " USAGE: /carcomponents for more info !");
}
}
else
{
SendClientMessage(playerid, COLOR_CORRECTION, "You are not authorized to use this command !");
return 1;
}
}
return 1;
}