2 Problems: Teleporting to a car, and a command to change skin.
#1

Код:
	if (strcmp("/rcar", cmdtext, true, 10) == 0)
	{
		new pName[MAX_PLAYER_NAME];
		GetPlayerName(playerid, pName, sizeof(pName));
		new PlayerState = GetPlayerState(playerid);
		if(strcmp(pName, "Sal", true, sizeof(pName)))
		{
		    if(PlayerState == PLAYER_STATE_DRIVER)
		    {
		        SendClientMessage(playerid, COLOUR_RED, "You cannot enter your car if you are in a vehicle");
		        return 1;
			}
			else
			{
			    PutPlayerInVehicle(playerid, SalElegy, 0);
			    return 1;
			}
		}
		return 1;
	}
This does nothing at all. I do the command, and there is nothing. Not even a Unknown Command. Not sure what's going on here.

Код:
	if(strcmp("/sal", cmdtext, true, 10) == 0)
	{
		new pName[MAX_PLAYER_NAME];
		GetPlayerName(playerid, pName, sizeof(pName));
		if(strcmp(pName, "Sal", true, sizeof(pName)))
		{
		    SetPlayerSkin(playerid, 181);
		    SetPlayerColor(playerid, 0x266464);
		    return 1;
		}
		else
		{
			SendClientMessage(playerid, COLOUR_RED, "You are not Sal");
			return 1;
		}
	}
This one straight up tells me I'm not Sal.
Reply
#2

Can u explain in a better way ?
Reply
#3

Well, not really. That's all I can see happening. /rcar does nothing at all, like, it doesn't teleport me into SalElegy. and /sal says "You are not Sal" even when I am clearly joining with the username "Sal".
Reply
#4

pawn Код:
if(strcmp("/sal", cmdtext, true, 10) == 0)
    {
        new pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, sizeof(pName));
        if(strcmp(pName, "Sal", false, sizeof(pName)))
        {
            SendClientMessage(playerid, COLOUR_RED, "You are not Sal");
        }
        else
        {
           
            SetPlayerSkin(playerid, 181);
            SetPlayerColor(playerid, 0x266464);
            return 1;
        }
    }
Reply
#5

pawn Код:
if(strcmp("/sal", cmdtext, true, 10) == 0)
    {
        new pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, sizeof(pName));
        if(!strcmp(name,"Sal",true))
        {
            SetPlayerSkin(playerid, 181);
            SetPlayerColor(playerid, 0x266464);
            return 1;
        }
        else
        {
            SendClientMessage(playerid, COLOUR_RED, "You are not Sal");
            return 1;
        }
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)