Would this work?
#1

Would something like this work?
pawn Код:
CMD:emst(playerid, params[])
{
tmp = strtok(cmd, idx);
if(strcmp(tmp, "1", true, strlen(tmp)) == 0)
{
for(new i=0;i<VCARS;i++)
{
if(ServerCars[i][FactionCar] == 1)
{
if(IsVehicleOccupied(i) == 0)
{
SetVehicleToRespawn(i);
EngineStatus[i] = 0;
if(strcmp(tmp, "2", true, strlen(tmp)) == 0)
{
for(new i=0;i<VCARS;i++)
{
if(ServerCars[i][FactionCar] == 2)
{
if(IsVehicleOccupied(i) == 0)
{
SetVehicleToRespawn(i);
EngineStatus[i] = 0;
return 1;
}
Reply
#2

Why are you using strtok =P? I'm not sure what you are doing exactly, but I'll give you a little example of what I think you're trying to do:

pawn Код:
CMD:emst(playerid, params[])
{
    if((params[0] == '1' || params[0] == '2') && !params[1])
    {
        new value =  strval(params);
        for(new i=0;i<VCARS;i++)
        {
            if(ServerCars[i][FactionCar] == value && IsVehicleOccupied(i) == 0)
            {
                SetVehicleToRespawn(i);
                EngineStatus[i] = 0;
            }
        }
    }
    return 1;
}
Reply
#3

New to ZCMD.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)