Why this Errors?
#1

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/welcome", cmdtext, true, 10) == 0)
    SendClientMessageToAll(RED,"Welcome");
    
     


	return 1;
}
{
    if (strcmp("/refunds", cmdtext, true, 10) == 0);
	GivePlayerMoney(playerid,2345000);
	SetVehicleParamsForPlayer(490,playerid,"nothing",doorslocked);

	return 1;
}
Errors:
Код:
\Script\gamemodes\FR.pwn(131) : error 055: start of function body without function header
D:\Script\gamemodes\FR.pwn(132) : error 010: invalid function or declaration
D:\Script\gamemodes\FR.pwn(136) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
WHy this Errors?
Reply
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/welcome", cmdtext, true) == 0)
    {
        SendClientMessageToAll(RED,"Welcome");
        return 1;
    }
    if (strcmp("/refunds", cmdtext, true) == 0)
    {
        GivePlayerMoney(playerid,2345000);
        SetVehicleParamsForPlayer(490,playerid,"nothing",doorslocked);
        return 1;
    }
    return 1;
}
Reply
#3

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/welcome", cmdtext, true) == 0)
    {
        SendClientMessageToAll(RED,"Welcome");
        return 1;
    }
    if (strcmp("/refunds", cmdtext, true) == 0);
    {
        GivePlayerMoney(playerid,2345000);
        SetVehicleParamsForPlayer(490,playerid,12,0);
        SetPlayerArmour(playerid,100);
        return 1;
    }
}
Errors:\Script\gamemodes\FR.pwn(12 : error 036: empty statement
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


how to fix it?
Reply
#4

pawn Код:
if (strcmp("/refunds", cmdtext, true) == 0);
to

pawn Код:
if (strcmp("/refunds", cmdtext, true) == 0)
Reply
#5

thanks man
Reply
#6

last thing::: Incluces and Definds:
[Code]#include <a_samp>
#include <a_http>
#include <a_Npc>
#include <a_objects>
#include <a_players>
#include <a_sampdb>
#include <a_vehicles>
#include <core>
#include <Datagram>
#include <file>
#include <float>
#include <String>
#include <time>

// #endif

#define RED 0xff000ff
#define GREY 0xAFAFAFAA
#define WHITE 0xFFFFFFAA
#define YELLOW 0xFFFF00AA
#define LIGHTBLUE 0x33CCFFAA
#define LIGHTGREEN 0x9ACD32AA
#define BLUE 0x5A8CA5AA
#define GREEN 0x33AA33AA
#define PURPLE 0xC2A2DAAA
#define COLOR_OTHER 0xFF6347AA
#define ORANGE 0xFF8C00AA
#define COLOR_DMV 0xFF0000F
#define COLOR_DMV2 0xaa3333AA
new players = 0;
new cars= 0;[codE]

my Scriptublic[Code] OnPlayerConnect(playerid)
{
SendClientMessage(playerid,RED,"Welcome to Player Rights Server");
SendClientMessage(playerid,YELLOW,"Admins are here to Help you if they Did anything Wrong Just tell the Owner");
SendClientMessageToAll(RED,"A player has Joined the Game");
printf("welcome to out server",1,2,3,4,5);
players+=1;
printf("there are Currently %d online",players);



return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
SendClientMessage(playerid,RED,"Hope to you to Come Back");
players--;
printf("there are currently %d players online ",players);

return 1;
}
[Code]

why NOthing Happen IG? why it doesn't Count the playerS?

I don't have any FS!
Reply
#7

sorry for this
Reply
#8

of course you using printf which will print in server console this is the correct version

pawn Код:
new string[128];
format(string, sizeof(string), "there are Currently %d online", players);
SendClientMessage(playerid, -1, string);
put it OnPlayerDis/Connect
Reply
#9

Can you Describe for me please What is this Code?

Thank you!
Reply
#10

Bro you used printf("there are currently %d players online ",players); this will only print in the server logs not in the client.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)