Helmet problem
#1

i want to write /helmet to put helmet on if i type again helmet then the helmet goes off pleasee help

Код:
#include <a_samp>
#define HELM_DIALOG 123456
//define the dialog ID here so it won't inflict with other dialogs on your gamemode.


public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/helm", true == 0) { //Using strcmp because i don't know your command processor, should be avoided anyway.
       if(IsPlayerAttachedObjectSlotUsed(playerid, 3))
          RemovePlayerAttachedObject(playerid, 3);
       else
          SetPlayerAttachedObject(playerid, 3, 18645, 2, 0.07, 0.017, 0, 88, 75, 0);
       return 1;
}
i have got 2 Errors.

Код:
C:\Users\ta\Desktop\NVCNR\filterscripts\helmets.pwn(8) : warning 213: tag mismatch
C:\Users\ta\Desktop\NVCNR\filterscripts\helmets.pwn(8) : error 001: expected token: ")", but found "{"
C:\Users\ta\Desktop\NVCNR\filterscripts\helmets.pwn(15) : error 030: compound statement not closed at the end of file (started at line 8)
Reply
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/helm", true == 0)) { //Using strcmp because i don't know your command processor, should be avoided anyway.
       if(IsPlayerAttachedObjectSlotUsed(playerid, 3))
          RemovePlayerAttachedObject(playerid, 3);
       else
          SetPlayerAttachedObject(playerid, 3, 18645, 2, 0.07, 0.017, 0, 88, 75, 0);
       return 1;
    }
}
Reply
#3

Quote:
Originally Posted by DanishHaq
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/helm", true == 0)) { //Using strcmp because i don't know your command processor, should be avoided anyway.
       if(IsPlayerAttachedObjectSlotUsed(playerid, 3))
          RemovePlayerAttachedObject(playerid, 3);
       else
          SetPlayerAttachedObject(playerid, 3, 18645, 2, 0.07, 0.017, 0, 88, 75, 0);
       return 1;
    }
}
i have got 2 warning

Код:
C:\Users\ta\Desktop\NVCNR\filterscripts\helmets.pwn(8) : warning 213: tag mismatch
C:\Users\ta\Desktop\NVCNR\filterscripts\helmets.pwn(15) : warning 209: function "OnPlayerCommandText" should return a value
Reply
#4

pls help
Reply
#5

pawn Код:
#include <a_samp>
#define HELM_DIALOG 123456

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/helm"))
    {
        if(IsPlayerAttachedObjectSlotUsed(playerid, 3))
        {
            RemovePlayerAttachedObject(playerid, 3);
        }
        else
        {
            SetPlayerAttachedObject(playerid, 3, 18645, 2, 0.07, 0.017, 0, 88, 75, 0);
        }
    }
    return 1;
}
Reply
#6

Quote:
Originally Posted by DanishHaq
Посмотреть сообщение
pawn Код:
#include <a_samp>
#define HELM_DIALOG 123456

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/helm"))
    {
        if(IsPlayerAttachedObjectSlotUsed(playerid, 3))
        {
            RemovePlayerAttachedObject(playerid, 3);
        }
        else
        {
            SetPlayerAttachedObject(playerid, 3, 18645, 2, 0.07, 0.017, 0, 88, 75, 0);
        }
    }
    return 1;
}
oh my god is working perfect thank u very very much
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)